3

We are wanting to determine shipping cost threshold based on membership. We have consumer products with orders over $15 free, and we also have trade products for members, and wish to extend the threshold to orders over $100 free shipping.

I have created two shipping methods (using default with rules), and was hoping it'd be as simple as the following on the cart page.

{if member_group == "6"}
    <input type="hidden" name="shipping_method" value="5">
{if:else}
    <input type="hidden" name="shipping_method" value="3">
{/if}

It almost works, but as we wish to show shipping cost on the main cart page, the above conditional hasn't been processed as the conditional is on the cart page.

Is there another way, or do we simply remove shipping cost from the cart page and only show it on final payment page (not ideal)?

Regards,

Christiaan

1
  • For the record, just indent code with 4 spaces or click the {} button for nice formatting :) Commented Jan 10, 2013 at 19:24

1 Answer 1

1

That is the best way to approach things. The only piece you are missing is that you either need to not display the shipping cost on your cart page, or automatically submit the form when the customer first hits the checkout to update the totals.

Something like this should do the trick:

{if member_group == "6"}
    <input type="hidden" name="shipping_method" value="5">
{if:else}
    <input type="hidden" name="shipping_method" value="3">
{/if}

{!-- automatically update shipping cost on first page load --}
{if shipping_method == ""}
    <script>
    $(function() {
        $('#update_totals_button').click();
    });
    </script>
{/if}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.