Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Luke Alderton 192 posts 509 karma points
    Feb 06, 2013 @ 18:07
    Luke Alderton
    0

    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

  • Anders Burla 2560 posts 8256 karma points
    Feb 06, 2013 @ 18:20
    Anders Burla
    0

    Cant you just hook into the country changed event?

    Kind regards
    Anders

  • Luke Alderton 192 posts 509 karma points
    Feb 06, 2013 @ 18:22
    Luke Alderton
    0

    Yes I was just wondering what that might be?

  • Luke Alderton 192 posts 509 karma points
    Feb 06, 2013 @ 18:23
    Luke Alderton
    100

    Assuming it's called 'WebshopEvents_CountryChanged'?

  • Anders Burla 2560 posts 8256 karma points
    Feb 06, 2013 @ 18:41
    Anders Burla
    0

    Yes :)

  • Luke Alderton 192 posts 509 karma points
    Feb 07, 2013 @ 10:13
    Luke Alderton
    0

    Okay now I feel stupid for asking a question I guessed right. haha.

  • Luke Alderton 192 posts 509 karma points
    Feb 07, 2013 @ 12:56
    Luke Alderton
    0

    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);

            }

  • Anders Burla 2560 posts 8256 karma points
    Feb 08, 2013 @ 00:13
    Anders Burla
    0

    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

  • Luke Alderton 192 posts 509 karma points
    Feb 11, 2013 @ 10:06
    Luke Alderton
    0

    Ah, I forgot to add 'WebshopEvents.CountryChanged += WebshopEvents_CountryChanged;' rookie mistake.

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft