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.
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.
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.
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.
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.
@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.
(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;
}
}
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.
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?
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.
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?")
(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.
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;
}
}
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;
}
}
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.
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?
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?
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;
}
}
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:
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.
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.
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.
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.
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.
@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.
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.
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?
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!
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?
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.
(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.
I don't know why and for the time being I prefer oblivion over knowledge! as long as it works.
thanks,
brian fidler
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>
<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>
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.
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?
As for the shipping issue, knowing the browser and OS helps, but we still need to be able to reproduce it to fix it.
<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>