Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Free Shipping Coupon

jwghcjwghc Member
in Help edited April 2012
Is it possible to offer a coupon that does free shipping? Or is there a work around solution for that?

i am using foxyshop if that makes a difference.
Tagged:
Comments
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    Hi @jwghc,

    Here's a snippet which you can use: http://wiki.foxycart.com/snippets/shipping/free_shipping_using_a_coupon (This goes in your checkout template so it isn't really a FoxyShop thing.)
  • jwghcjwghc Member
    Thanks @sparkweb I will look into this.
  • Hi there, I have used setup 1 from the link you suggested, to allow a coupon for free shipping. In my particular case I'd like free shipping only for FEDEX category. However I have the custom code:

    if (isFedex) {
    FC.customLiveShipping.hide('all');
    FC.customLiveShipping.show("FedEx");
    }

    that is hiding everything except FedEx shipping when it is a product within FEDEX category.
    How can show free shipping for FEDEX when a customer enter a "free shipping" coupon ?

    Thanks.
  • lancelance Member, Community Support Member
    @diegoecom -

    Where are you calling your FedEx code? You should be able to use most of the Setup 1 code inside your if(isFedex) conditional, but you probably want to wrap it all in the shipping methods complete callback. Something like this might be what you're looking for, but you should make sure it fits in with the rest of your custom logic - I suspect there's more than just the snippet you posted:
    jQuery(document).ready(function(){
    	jQuery("#fc_shipping_methods_inner").ajaxComplete(function(event, request, settings) {
    		jQuery("label[for='shipping_service_60']").hide();
    		if (isFedex) {
    			FC.customLiveShipping.hide('all');
    			FC.customLiveShipping.show("FedEx");
    			if(fc_json.hasOwnProperty('coupons')) {
    				jQuery.each(fc_json.coupons, function(i, coupon){
    					if(coupon.name.search(/free shipping/i) > -1) {
    						jQuery("label[for='shipping_service_60']").show();
    						jQuery("label[for='shipping_service_60'].fc_shipping_service").text(coupon.name);
    					}
    				});
    			}
    		}
    		if (jQuery("label[for='shipping_service_60']").is(":hidden")) {
    			jQuery("label[for='shipping_service_60']").remove();
    		}
    	});
    });
    

    Does this help?

    Lance
  • fc_adamfc_adam FoxyCart Team
    @lance - looks like @diegoecom is using the live shipping modification snippet, so the custom code as part of that is already in a callback method.

    @diegoecom - The following should get you sorted, but could you link to your checkout? I'd like to see what you've got setup already.
    if (isFedex) {
    	FC.customLiveShipping.hide('all');
    	FC.customLiveShipping.show("FedEx");
    	if(fc_json.hasOwnProperty('coupons')) {
    		jQuery.each(fc_json.coupons, function(i, coupon){
    			if(coupon.name.search(/free shipping/i) > -1) {
    				FC.customLiveShipping.hide('all');
    				FC.customLiveShipping.show(60);
    			}
    		});
    	}
    }
    

    This will only show the free shipping option in the checkout if the coupon is present and 'isFedex' is true - whatever that is set from.
Sign In or Register to comment.