Flat Rate Domestic-Live Rate International

songworkssongworks Member
My client wishes to make all products flat-rate shipping US only, and still use live rates for International Shipping. He uses USPS and UPS. I think for USPS I would simply disable Domestic and enter flat-rate price in each product category. Is that correct? However, UPS is a bit confusing. The checkbox is for 'Domestic and International Shipping'. There doesn't appear to be a way to disable just Domestic Shipping?
Comments
  • fc_adamfc_adam FoxyCart Team
    @songworks,

    To achieve what you're after there, you'll need to keep using live rates for domestic as well, and then use our live rates modification snippet to hide them for domestic orders and instead show a custom flat rate. The reason that you need to keep with live rates for all orders is because we don't currently support specifying different shipping types conditionally within the administration. It's something we're looking to support in the future though.

    For the snippet to work, it needs to still have live rates returned successfully - so you'll want to maintain enough domestic live rate options that each address will have something returned. You can then hide those and show your custom rate like this:
    if (FC.json.shipping_address.country == "US") {
    FC.customLiveShipping.hide("all");
    FC.customLiveShipping.add(1000, 5.95, "", "Flat Rate Shipping");
    }
    You can see details on setting up the snippet for a 2.0 store here: https://wiki.foxycart.com/v/2.0/snippets/live_rate_shipping_modification

    Let us know if you have any other questions about setting that up - we're here to help!
  • OK great. The snippet you provided works perfectly! Thanks for that. Of course, now my client wants to include the option of shipping overnite for both USPS and UPS......live shipping rate. I should've seen this coming! :)
  • fc_adamfc_adam FoxyCart Team
    @songworks,

    No problems! You can simply modify the custom shipping logic to show any of the necessary rates they want to offer domestically in the logic, for example if they wanted to include UPS Next Day Air:
    if (FC.json.shipping_address.country == "US") {
    FC.customLiveShipping.hide("all");
    FC.customLiveShipping.show("UPS Next Day Air");
    FC.customLiveShipping.add(1000, 5.95, "", "Flat Rate Shipping");
    }
    If you set it to show the rates they still want to include, you should be all good to go!
  • OK that solves it. Thanks!
Sign In or Register to comment.