2

We have a client with an Expresso Store install where they have specified shipping rules for certain countries only and wish to add more as and when they have time.

<select id="shipping_country" name="shipping_country" class="form-control">
{shipping_country_options}
</select>
{error:shipping_country}

Is there a way to have the shipping country list determined by those with shipping rules? For example I have the following UK shipping rules set up:

enter image description here

However despite only have shipping rules pertaining to the UK other countries still show up in the country select list for shipping.

1

Well technically you have shipping rules setup for every country since you have a rule with the country set as "Any".

IF you are only shipping to a few different countries you have a few options. You can either build the option list out yourself.

Something along the lines of:

<select id="shipping_country" name="shipping_country" class="form-control">
 <option value="">Select a country</option>
 <option value="USA">United States</option>
 <option value="GRB">Great Britain</option> 
</select>
{error:shipping_country}

With this approach Store is still technically allowed to take orders from any country but your options will be limited to what you manually code into your templates. If you add a new country you need to modify your template. I have seen people get around this with a Low Variables filed in the past where they would allow the admin to select multiple countries then output the select by looping though the checked countries.

Store also has the ability to disable certain countries. For example if you are selling liquor in the US you usually can't ship to other countries so you could goto Store > Settings > Counties / States menu and disable all of the countries that you don't want to ship to. This will automatically update your templates if you enable a new county if you are using the {shipping_country_options} helper tag. You would still need to create the shipping rules for each new country though.

  • Thanks Justin, manually coding the select list isn't really an option for this client... guessing I might be able to code a custom plug-in which does a JOIN on countries and shipping methods... :) – Nathan Pitman Jan 30 '15 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.