How to Set Shopping Cart Price Rule for All Shipping Countries Except One in Magento 1.9

ce-1.9.2.2magento-1.9shopping-cart-price-rules

I want to create a discount code that automatically is applied to all shipping countries except for the UK.

My default shipping country is UK but when a new user enters the site magento seems to consider the default shipping country unset until you open the checkout. The result is that if I set the price rule to "Shipping country is not UK" the discount will be applied directly until the user opens the checkout (so the minicart and shopping cart page will show the wrong price until the user reaches checkout).

A solution that works is to set a rule for every non-uk country as in hundreds of rows of "Shipping country is Canada", "Shipping country is Australia", etc. I am though not really interested in spending a couple of days entering all these.

So I'm all ears for ideas on how I can get my price rule to not apply for users that havn't set their shipping country and for users that have set it to UK but have it applied for all other countries. And to do this without manually entering hundreds of lines in the price rules.

Best Answer

Step 1: Create your initial Rule

  • Add the Condition Shipping Country is not United Kingdom
  • Add a Priority e.g. 5
  • Add the Discount

Step 2: Create a Second Rule

  • Add the Condition Shipping Country is ... <- Leave the Country Empty
  • Add a Priority e.g. 3 (should be lower the the Priority from Rule 1)
  • Choose in the Action Tab Stop Further Rules Processing = Yes

Explanation

The Second rule serves as a "Stop-Rule". What happen is, the Stop Rule has an lower Priority, so this rule fires first. For a new User the Condition of the Rule is true, because the shipping country is ... (empty). And then it stops all further Rules.
If the first Rule is true, shipping country != GB (the second rule is automatically false). So, the customer gets the discount.

This solution doesn't affect other rules, because the default priority is 0.

Related Topic