free shipping for orders over $49

free shipping for orders over $49, it was working, we had this in Checkout page. But now its not working

/*if (state != "NY") FC.customLiveShipping.remove("pickup");*/

if(free_ship==1){ // free ship condition
FC.customLiveShipping.show("free");
}else{

if (country == "US" && FC.json.total_item_price >= 49) { //change condition from 49 into 1
// FC.customLiveShipping.remove("free");
FC.customLiveShipping.show("free");

}else{

if(country == "US"){

FC.customLiveShipping.add(100, 3.99, 'Ground', 'Standard Delivery');
FC.customLiveShipping.remove("free");
}else{
FC.customLiveShipping.remove(1);
FC.customLiveShipping.remove("free");
}

}
Comments
  • fc_marijafc_marija FoxyCart Team
    Hello @clickhere2shop -

    Sorry to hear your shipping rates aren't working properly. It looks like Free shipping is showing for orders that are also under $49, is that what you're experiencing?

    Looking at the inspection tools in the browser, I can see a javascript error on your page related to the live rates modification snippet that is included in your cart include template. The specific issue is that the snippet seems to have some line breaks added to it which is causing a javascript error. This is stopping the javascript from being executed.

    To fix it, you'll want to replace the custom live rates snippet with the version from the wiki again. This should get rid of those line breaks and should get everything working for you again. You can see the snippet here: https://wiki.foxycart.com/v/2.0/snippets/live_rate_shipping_modification

    Note that when you copy in the new snippet - you'll want to make sure you also copy over your custom shipping logic from the snippet as you have it now.

    I want to take this opportunity to mention that we now have a new feature that allows you to create custom rates in a simpler and more stable way than in the checkout template. The Custom Shipping Code option creates those rates using server-side JavaScript rather than on the client side.

    We'd love to see if we can help you move over to the new feature. We'll translate the code from your checkout to the new format and give you step-by-step instructions for making the changes.

    Please contact us at help@foxycart.com when you're ready to do that.
Sign In or Register to comment.