Coupon on checkout

mreeemreee Member
in Help edited August 2013
Right now I have the coupons on the checkout page.

my cheapest product is 19.99 with free shipping.

I have a free coupon, but if they use the free coupon there is no free shipping.

The problem that I'm having is that if customers enter the free coupon on the checkout page they get a free product and free shipping. This happens because shipping is calculated on page load if they put in the free coupon shipping is not recalculated.

Is there a way to force the page to reload if a coupon is added on the checkout page.


Thanks!
Comments
  • fc_adamfc_adam FoxyCart Team
    @mreee,

    There is - could you link us to your checkout so we can see exactly what you're working with? Essentially it'll be adding in some extra javascript.
  • fc_adamfc_adam FoxyCart Team
    @mreee,

    In the custom code for adding coupon entry to the checkout, make the following two changes:

    First, before this line:
    FC.checkout.BuildCouponTR(data.coupons);
    

    Add this line to make it this:
    fc_json = data;
    FC.checkout.BuildCouponTR(data.coupons);
    


    Then after this line:
    FC.checkout.updatePriceDisplay();
    

    Add this line to make it this:
    runShippingLogic();
    FC.checkout.updatePriceDisplay();
    


    That will force the custom shipping logic to run after a coupon is added on the checkout.
  • @fc_adam,

    I added the code but it does not change the shipping.
  • fc_adamfc_adam FoxyCart Team
    @mree,

    Ah - the shipping logic is only set to update if the country has changed. For what you need though, you need it to run if other aspects have changed too. With that in mind, try updating your custom logic with this: http://pastie.org/private/bfe6jqankqgcqgqhvtxawq
  • Thanks! That worked for me.
Sign In or Register to comment.