Is it possible to hide all other shipping options( only to show international shipping) in expresso store if the country code is not U.S or Canada?
Has anyone had experience with this?
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It only takes a minute to sign up.
Sign up to join this communityTo follow up on this using some of the logic Justin explains below I came up with a solution that also updates available shipping methods, shipping cost & order total when either shipping_country or shipping_method dropdowns are changed. http://bit.ly/16x5VOY
$(document).ready(function() {
$("#shipping_country,#shipping_method").change(function() {
var url = $(this.form).attr('action');
var data = $(this.form).serialize();
$.post(url, data, function() {
/* Update Method */
$('#shipping_method').load('/store_example/_update-form #shipping_method');
/* Update Cost */
$('.shipping-cost').load('/store_example/_update-form .shipping-cost');
/* Update Total */
$('.order-total').load('/store_example/_update-form .order-total');
});
return false;
});
});
Having some trouble getting the AJAX posts to update properly, hopefully someone from store can chime in as there is very little documentation on a practical use of shipping methods. The main problem involves when switching dropdown shipping_country from US > France the shipping_cost & order_total values don't update. If then switch from France > United Kingdom the values do change as expected. This may be more of syntax question, but will definitely help future store users trying to replicate the same functionality.
You can create a conditional to check the users shipping location and then show options available. Lets assume from the attached image
I wanted to have 1 for outside of the US, 5 for Australia and the rest for the US. I could template something along the lines of
<select name="shipping_method">
<option value="">Select shipping method...</option>
{if shipping_country != "us" OR shipping_country != "au"}
<option value="1" selected="selected">World Shipping</option>
{/if}
{if shipping_country == "us"}
<option value="6">FedEx Priority</option>
<option value="7">UPS</option>
<option value="8">USPS</option>
<option value="9">FedEx Slow</option>
<option value="10">More USPS</option>
{/if}
{if shipping_country == "au"}
<option value="5" selected="selected">Australia Post</option>
{/if}
</select>
This is something that is going to be addressed in an upcoming release so help streamline this for developers and being able to pull multiple shipping quotes with a single request.
When dealing with flat rate shipping for INTL orders, if only there was a select rule called "Any Country Besides [[country value]]". That way, no importing rules for every country.