The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Free Shipping on orders over 199.00

liftaleeliftalee Member
in Help edited July 2009
Can set this up? If so, How?

Thanks
«1
Comments
  • lukeluke FoxyCart Team
    edited July 2009
    Hey liftalee. Check this post for details: http://forum.foxycart.com/comments.php?DiscussionID=522

    Step 1) Turn on the custom free shipping option in your FoxyCart admin
    Step 2) Add the javascript to your checkout template

    If you don't need to specify specific zip codes like that script does, you can just use this:
    <script type = "text/javascript"charset = "utf-8" >
    var myCustomShipping = function() {
    	jQuery("label[for='shipping_service_60']").hide();
    	if ($('#subtotal').val() > 199) {
    		jQuery("label[for='shipping_service_60']").show();
    	}
    }
    jQuery(document).ready(function() {
    	jQuery("#fc_shipping_methods_inner").ajaxComplete(function(event, request, settings) {
    		myCustomShipping();
    	});
    });
    </script>
    
  • Thank a bunch Luke, I need this.
  • oskayoskay Member
    Thank you-- this is *great*!
  • lukeluke FoxyCart Team
    PLEASE NOTE:
    It's come to our attention that handling fees are still being applied with the "Free ground shipping" custom shipping option even though they don't show up on the checkout page. We're looking into this issue. If you're using the Free Ground Shipping option you should remove your handling fees.
  • kevinbkevinb Member
    edited July 2009
    OK, sorry for being totally obtuse here, but where can I "Turn on the custom free shipping option in your FoxyCart admin" ? I didn't see it anywhere...

    OK, I found it under Shipping: Custom. But when I placed the script above in my template (after ^^checkout^^) it didn't make the change to show $0.00 for shipping. I'm sure I'm missing something here. Any further advice would be appreciated.
  • lukeluke FoxyCart Team
    Can you send us a link so we can take a look? It probably should be in the HEAD section of your page in a script tag. Also, you might want to use firebug to check for any JavaScript errors.

    Please note: the above is a hack until we implement SuperShip and if you have handling fees, things will get messy because they won't show up in the checkout preview but will end up being charged.
  • kevinbkevinb Member
    Luke,

    Thanks for the response. I realized today that this was mostly my problem - I still had Flat Rate Shipping enabled. I'll play around with going to regular shipping and see if I can use this and will let you know. I think that I'll have to tell the client to wait for Supership and that, for now, they can't have their cake (flat rate) and eat it to (free on orders over $xxx). If you do have an idea I would appreciate any feedback. Thanks.
  • oskayoskay Member
    One more bug to fix in that script: it should use #subtotal not #order_total.

    As it is written (and guess how we found out...), if the subtotal (sum price of products) is below $X, but the order total exceeds $X after sales tax is added, shipping becomes free.
  • lukeluke FoxyCart Team
    @oskay: thanks oskay! Post edited.

    @kevinb: I think you posted in another thread about this, but there might be a way to do it by using flat rate shipping in the admin set to $0 and then use some javascript to check the contents of the cart and update FC.checkout.config.orderFlatRateShipping to be what you want based on the value in the cart.
  • kevinbkevinb Member
    edited October 2009
    (ADMIN EDIT: This code is not recommend as it will break taxes. Please see the code in a later post to modify FC.checkout.config.orderFlatRateShipping instead)


    Luke,

    I got this mostly working. Here's what I did:

    As mentioned, I want this for Flat Rate Shipping. I took the code from the other thread:

    function calculateShipping(amount) {
    if (amount >= 75) {
    return 0;
    } else {
    return 6.95;
    }
    }

    jQuery(document).ready(function() {
    FC.checkout.override("updatePrice","myUpdatePrice");
    FC.checkout.config.orderShipping = calculateShipping(fc_json.total_price);
    FC.checkout.updatePriceDisplay();
    });

    var myUpdatePrice = function() {
    FC.checkout.updatePaymentDisplay();
    }

    Interestingly, it only worked with FC.checkout.config.orderShipping but nothing happened with FC.checkout.config.orderFlatRateShipping.

    Unfortunately, this spawned a completely separate problem. With this in place, it correctly figured out the proper SHIPPING rate, but for some reason the TAXES ended up 0 on the checkout page. It worked just fine when I went to the receipt page (which also has this code), and if I removed that code, the cart on the checkout page automatically updated with the proper tax. Any help would be appreciated. This can be found on http://strikingskincare.com/product.html.
  • lukeluke FoxyCart Team
    Is your store configured to use flat rate shipping or live shipping rates?

    There are a few threads going on right now about these customizations and they are probably causing more trouble then they are helping since they are not specific to which version they are being used with. In the latest version Taxes are calculated along with live shipping rates as part of the updatePrice method. By overriding the updatePrice method, you're actually blowing away a lot of default functionality including tax calculations.

    Did the suggestion I made about using flat rate shipping not work?
  • Luke,

    My store is configured to use Flat Rate Shipping. And you must have hit it right on in that I'm blowing away default functionality and that's why the taxes aren't calculated on-the-fly.

    When I changed the code above to have FC.checkout.config.orderFlatRateShipping instead of FC.checkout.config.orderShipping, it didn't work. That is, the shipping stayed at 0, which is what I have it set in the admin, regardless of whether I had surpassed the amount (in my case $75).

    My apologies about the multiple threads. I thought this would be the best one since the subject line is exactly what I want to happen. The kicker, I suppose, is that I also want it to happen with Flat Rate Shipping. But from what you say, that taxes are calculated during the updatePrice method, it sounds like I can't be messing with updatePrice to achieve my goal.

    Is there something that I can add to the above code to force the tax calculation and display? To tell you the truth, when I look at the code I'm using, I'm not sure exactly what it's doing but since it was so close, I thought I could get away with it :-). Any suggestions would be welcome.

    Thanks!
  • lukeluke FoxyCart Team
    Kevin: this thread should be close to what you want: http://forum.foxycart.com/comments.php?DiscussionID=1537

    The only difference being you need to check the json cart and if the price in the cart should get free shipping, you set it to 0. Make sense?
  • kevinbkevinb Member
    edited June 2011
    Luke,

    Success! I'm going to post a brand new thread about this, but here's the final code:

    <script type="text/javascript" charset="utf-8">
    function calculateShipping(amount) {
    if (amount >= 75) {
    return 0;
    } else {
    return 6.95;
    }
    }

    jQuery(document).ready(function() {
    FC.checkout.config.orderFlatRateShipping = calculateShipping(fc_json.total_price);
    FC.checkout.updateShipping(-1);
    });
    </script>

    You were right about the .orderFlatRateShipping :-). I'm not sure what sending the -1 to updateShipping is doing, but the LIVE update of the tax is showing up as expected. Thanks.

    - - - -

    [Admin Edit] - Make sure you set Flat Rate shipping for your categories to be 0 when using this method.
  • I'm using the "free shipping over X" hack listed here. It seems to me that because I have this, we are *not* getting an error message displayed when USPS is unable to return a rate error. My understanding is that the "shipping rate error" is displayed when no shipping options are available, and that having the (hidden) free option removes the possibility to display an error message. Is that correct?

    (These hacks do get messy fast. Any chance of a "pretty good ship" project before "super ship?")
  • brettbrett FoxyCart Team
    edited August 2009
    (These hacks do get messy fast. Any chance of a "pretty good ship" project before "super ship?")

    Yes, actually. We are _definitely_ planning on doing "super ship" incrementally, since any improvements would be nice. Thanks oskay for chiming in though. We'll explore this potential problem.
  • Kevinb! that rocks. I've been struggling with this for months. I couldn't get code from the other post to work but your code worked like a charm.

    I don't know why and for the time being I prefer oblivion over knowledge! as long as it works.

    thanks,
    brian fidler
  • Hey Kevin,

    I'm using a flat rate shipping but want orders over £100 to be delivered free...
    I have added your code to the head of the checkout template but it is still adding the shipping charge regardless.

    Did you change your shipping or handling settings to get this to work?
    <script type="text/javascript" charset="utf-8">
    function calculateShipping(amount) {
    if (amount >= 100) {
    return 0;
    } else {
    return 3.95;
    }
    }

    jQuery(document).ready(function() {
    FC.checkout.config.orderFlatRateShipping = calculateShipping(fc_json.total_price);
    FC.checkout.updateShipping(-1);
    });
    </script>
  • lukeluke FoxyCart Team
    Can you provide a url so we can take a look?
  • I'm using this code kevin posted but and when tested it works but i just had a customer place an order last night who spent $148.88 and it charged them shipping, should be free over $99. is it possible there browser blocked the code?

    <script type="text/javascript" charset="utf-8">
    function calculateShipping(amount) {
    if (amount >= 99) {
    return 0;
    } else {
    return 6.95;
    }
    }

    jQuery(document).ready(function() {
    FC.checkout.config.orderFlatRateShipping = calculateShipping(fc_json.total_price);
    FC.checkout.updateShipping(-1);
    });
    </script>
  • lukeluke FoxyCart Team
    Without seeing the code in context, it's hard to say. There might be browser/os/browser version considerations to take into account as well... what works for one may not work for another. This isn't officially supported code, so that also makes it difficult.

    As I said on the 5th, can you provide a url so we can take a look? Without that, there's not much we can do.
  • www.mxbeltbuckle.com
  • lukeluke FoxyCart Team
    Thanks Mike. I looked things over and don't see any JavaScript errors or any reason why this would not work. I tried adding the exact products that were in the transaction you mentioned and was not able to reproduce the error. I tested in Chrome, FireFox, IE and Safari on the PC. Would it be possible to contact the customer and find out what OS and browser version were used? Is there any chance changes were made in the store around the time that transaction was placed? Have you been able to reproduce this on your end?
  • lukeluke FoxyCart Team
    Oh, also, you may want to add a link to your cart, not just your checkout. I found it a little difficult on your site to get to my cart and modify the contents after adding something to it. You can easily add a link to the cart by linking to your foxycart store and cart?cart=view. Be sure the link has class "foxycart" to bring up the cart window as well.
  • Yeah I would rather have the link at the top be for the cart, what would the exact URL before I'll just swap out the checkout page for the cart page link.

    Ok I found out the person had windows vista and using internet explorer 7. i had another customer have the same problem I didnt' ask them what O/S they had, I tested it and it work for me but so far 2 customers it didn't work for in a 5 day period so something else needs to be done but wow is this hard to troubleshoot, any ideas?
  • lukeluke FoxyCart Team
    For the cart link, it would just be this:
    <a href="https://yourfoxycartsubdomain.foxycart.com/cart?cart=view"; class="foxycart">View Cart</a>
    
    just repalce "yourfoxycartsubdomain" with your store's value. More info here: http://wiki.foxycart.com/getting_started:adding_links_and_forms

    As for the shipping issue, knowing the browser and OS helps, but we still need to be able to reproduce it to fix it.
  • What would the javascript above be if free shipping depends on number of items purchased as opposed to sales value? e.g. 10+ items = free shipping
  • bjbkbjbk Member
    @intandem, simply change
    fc_json.total_price
    
    to
    fc_json.product_count
    
    , and alter the amount in the calculate shipping function from 99 to 10, and you should be good to go!
  • intandemintandem Member
    edited March 2010
    Yeah, I got it to work! Quantity-based volume discount as well as quantity-based flat-rate shipping/free shipping. Thanks bjbk for your help as well as to everybody else who contributed to this thread.
  • HELP, How can we make this work if people use COUPONS!!!??? This code is allowing free shipping to go off the price BEFORE coupons. So I have my shipping free with orders over $79, well the total is say $105 but after coupons the order is only $76 but its giving them free shipping because the subtotal is $105, NOT GOOD, please help!? I don't mind flat rate shipping but ideally I'd like to just charge $1.95 per item instead of doing the flat rate.... here is the code I'm using www.mxbeltbuckle.com

    <script type="text/javascript" charset="utf-8">
    function calculateShipping(amount) {
    if (amount >= 79) {
    return 0;
    } else {
    return 5.95;
    }
    }

    jQuery(document).ready(function() {
    FC.checkout.config.orderFlatRateShipping = calculateShipping(fc_json.total_price);
    FC.checkout.updateShipping(-1);
    });
    </script>
Sign In or Register to comment.