I've created a tea commerce extension to work out shipping however in the checkout, when the client changes country, the extension method is not called, the client would need to either add a new product or change quantity for it to update the shipping cost, is there a method I could override or something else I could use to make the shipping update when a country is selected?
Event on country change override
Hi,
I've created a tea commerce extension to work out shipping however in the checkout, when the client changes country, the extension method is not called, the client would need to either add a new product or change quantity for it to update the shipping cost, is there a method I could override or something else I could use to make the shipping update when a country is selected?
Thanks in advance,
Luke
Cant you just hook into the country changed event?
Kind regards
Anders
Yes I was just wondering what that might be?
Assuming it's called 'WebshopEvents_CountryChanged'?
Yes :)
Okay now I feel stupid for asking a question I guessed right. haha.
Having said that, I've used the following in my extension however it doesn't seem to be calling it...
/// <summary>
/// On country change
/// </summary>
/// <param name="order"></param>
/// <param name="country"></param>
void WebshopEvents_CountryChanged(Order order, Country country)
{
UpdateOrderShippingCost(order);
umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Error,
umbraco.BusinessLogic.User.GetUser(0), -1,
"changed country to: " + country.Name + " and order country is " + order.Country.Name);
}
Did you code a Visual Studio project for this and build your dll and copied it to your bin folder?
How did you implement the event? Did you do it like this?
http://rune.gronkjaer.dk/en-US/2010/11/26/how-to-use-the-tea-commerce-events/
Kind regards
Anders
Ah, I forgot to add 'WebshopEvents.CountryChanged += WebshopEvents_CountryChanged;' rookie mistake.
Thanks!
is working on a reply...