Flat rate & live rate version 2

nockadilenockadile Member
Hello,
I upgraded to version 2 and no longer have my custom shipping logic. Can you please help me with this?

Cart total $11.50 or less would have a flat rate of $7 shipping.
Cart total from $11.51 to $23 would have a flat rate of 8.50 shipping.
Cart total greater than $23 would have live rates.

Thank you!
Tagged:
Comments
  • fc_adamfc_adam FoxyCart Team
    @nockadile,

    Happy to help!

    For what you've described there - you would make use of the live rates snippet from this wiki page: https://wiki.foxycart.com/v/2.0/snippets/live_rate_shipping_modification

    Follow the steps as detailed on that page, and then for the custom logic - it would look like this:
    if (FC.json.total_item_price < 23) {
    FC.customLiveShipping.hide("all");
    var flat_rate = 7;
    if (FC.json.total_item_price > 11.50) {
    flat_rate = 8.5;
    }
    FC.customLiveShipping.add(1000, flat_rate, "", "Standard Shipping");
    }
Sign In or Register to comment.