Figured I'd contribute to the community here for developers who want to do things we figured out how to do for some of our clients. One of these things was a "Free Shipping" coupon code.
First, set up a coupon for a $0.01 discount. Give it a code (for the example, we'll use "SHIP4FREE") and a name ("Free Shipping!").
UPDATE: A tip from billsmithem to avoid the penny discount:
Then, enable free shipping on your account (in the Foxycart admin: STORE -> shipping -> CUSTOM OPTIONS -> custom domestic services -> free ground shipping). I would also suggest renaming the option to "In-Store Pickup" or something like that, so that if the script fails to hide the option it won't result in customers expecting free shipping.
Then, in your checkout script, include the following javascript:
First, set up a coupon for a $0.01 discount. Give it a code (for the example, we'll use "SHIP4FREE") and a name ("Free Shipping!").
UPDATE: A tip from billsmithem to avoid the penny discount:
Instead of using a $.01 discount, I set up a coupon for 0% discount for 1 or more items and it seems to be working just fine.
Then, enable free shipping on your account (in the Foxycart admin: STORE -> shipping -> CUSTOM OPTIONS -> custom domestic services -> free ground shipping). I would also suggest renaming the option to "In-Store Pickup" or something like that, so that if the script fails to hide the option it won't result in customers expecting free shipping.
Then, in your checkout script, include the following javascript:
jQuery(document).ready(function(){ jQuery("label[for='shipping_service_60']").hide(); jQuery("#fc_shipping_methods_inner").ajaxComplete(function(event, request, settings) { jQuery("label[for='shipping_service_60']").hide(); if(fc_json.hasOwnProperty('coupons')) { if (fc_json.coupons['SHIP4FREE'].name == "Free Shipping!") { jQuery("label[for='shipping_service_60'] .fc_shipping_service").text("Free Ground Shipping!"); jQuery("label[for='shipping_service_60']").show(); } } }); }); |