Announcement

Collapse
No announcement yet.

Automatic Discount at Checkout Restricted by Country

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Automatic Discount at Checkout Restricted by Country

    Hello everyone,

    I need to trigger an automatic discount at checkout based on ship country. I have the Emporium Plus Toolkit, and I know I can do this exact thing, but I don't know the code for it. I tried using an if statement but it will not recognize the restriction. We are giving 25% off the basket subtotal for international orders outside of the US and Canada. Here is the code I tried:

    Code:
    <mvt:if expr="g.Basket:ship_cntry NE 'US' AND g.Basket:ship_cntry NE 'CA'">
    <mvt:item name="toolkit" param="discount|'International Discount 25%'|'25%'|0|" />
    </mvt:if>
    I really wish the built in discounts module offered country restriction like my old modules used to.

    Thanks so much,
    Beth Shaffer
    Last edited by bshaf; 11-13-17, 12:05 PM.

    #2
    Try changing
    <mvt:if expr="g.Basket:ship_cntry NE 'US' AND g.Basket:ship_cntry NE 'CA'">

    to

    <mvt:if expr="g.Basket:ship_cntry NE 'US' OR g.Basket:ship_cntry NE 'CA'">

    Comment


      #3
      Changing the if statement to OR does not work either. In the Toolkit docs, it says:

      132: Use discount to apply one discount per session on any page template. You can wrap the token with just about any combination of store morph conditionals you want. Use it as a coupon. Use it for an amount (fixed or percent) off the total or just one single product. Restrict to a specific price group or no price group. Restrict to a specific location. Have a different percent off based on the basket total. The conditions are limited by your imagination. The token has 5 parameters. The 5th is optional. The second parameter is the label that shows in the basket page. Beginning with version 5.244 you can use either a string literal or a variable for the 2nd parameter. If you use a string put an apostrophe around the text, for example 'Facebook Disount'. If you use a variable, leave off the apostrophes, for example g.savingsmessage. The third parameter is the amount. Surround that value with the apostrophe if it is a string. If it is a variable, leave off the ' so it might look like |l.amount|. The 4th parameter is if it is taxable or not. If you want it to reduce the tax of the order, make that a 1 instead of a zero. The fifth parameter defines what values are calculated in the display of the order total. When the token reduces the order total, it overwrites the order total that is shown in the basket. It does not change the order total in the database; that is done in the background between pages. This function makes the change on the actual page rather than between pages. Probably the only screen you would use the fifth parameter on is the OPAY page because on that page the new values for shipping and tax appear. So the displayed total has to include those values. The text to put in the fifth parameter, if used, is ST.
      <mvt:item name="toolkit" param="discount|FaceBook Discount 5%|'5%'|0|" />
      So I can restrict to location. I wish this example told me how.

      Comment


        #4
        I also have the Coupon Redemption module. It has country restriction. Until now, I have been displaying a notice for customers whose ship country is not the US or Canada, giving them the coupon code. The problem is many customers ignore it, then I have to manually give them the discount. Here is my code, which does work.

        Code:
        <mvt:if expr="g.Basket:ship_cntry NE 'US' AND g.Basket:ship_cntry NE 'CA'">
        <mvt:item name="couponrd" param="osel" /><p><span style="color: red; font-weight: bold;">ATTENTION!</span> Enter code INTERNATIONAL in the coupon field above to receive 25% off of your order!</p>
        </mvt:if>
        What I'd like to do is something like...
        Code:
        <mvt:if expr="g.Basket:ship_cntry NE 'US' AND g.Basket:ship_cntry NE 'CA'">
        <mvt:item name="couponrd" param="osel" value="INTERNATIONAL" />
        </mvt:if>
        This does not work. If I could just auto-enter the coupon code for the customers who should get the discount, it would fix my issue.
        Thanks

        Comment

        Working...
        X