Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Sep 20, 2015 @ 08:44
    Peter Gregory
    0

    Tea Commerce Free shipping only in certain country

    Hey Tea Commerce team.

    I'm trying to setup a marketing discount code that apply only to certain countries and not all countries.

    We want to offer free shipping only within a certain country. How can we do this?

    Thanks

    Peter

  • Laurence Gillian 600 posts 1219 karma points
    Sep 22, 2015 @ 09:45
    Laurence Gillian
    0

    Hi Peter,

    If you only have one shipping method (e.g default shipping) per country, then changing the shipping method programatically is quite easy.

    However, if you need multiple shipping methods per country, it's back to the drawing board!

    1 shipping method per country, with Promo code override

    Make a new Shipping Method.

    e.g. "Free Shipping"

    On the shipping method, update so it's selectable on the Country you require.

    The in your code you can:

    var freeShippingId = 6; // id of free shipping method
    var storeId = 1;
    string code = Request.Form["code"] ?? null; // promo code, where ever it comes from
    
    if (code = "Free Shipping") { 
      ShippingMethod shippingMethod = TC.SetCurrentShippingMethod(storeId, freeShippingId);
    } else {
      ShippingMethod shippingMethod = TC.SetCurrentShippingMethod(storeId, null);
    }
    

    That's somewhat basic! But it's a starting point :-)

Please Sign in or register to post replies

Write your reply to:

Draft