Try our conversational search powered by Generative AI!

Configure Shipping Method - When does SaveChanges and LoadObject get called?

Vote:
 

Hi there,

We are configuring a new shipping method and can see we need to implement a two methods which are SaveChanges and LoadObject. We are wondering where and when these two methods get called? Everything in the documentation is clear apart from this.

Thanks

#208339
Oct 22, 2019 11:05
Vote:
 

Which interface are you implementing? I don't recognize those methods are required 

#208348
Oct 22, 2019 12:41
Vote:
 

My colleague notified me about this https://world.episerver.com/documentation/developer-guides/commerce/shipping/Shipping-methods/, so I assume you are implementing ConfigureShippingMethod.ascx which needs IGatewayControl. LoadObject is called when Commerce Manager loads your shipping method, and SaveChanges is called when someone click Save (your shipping method). each will be called with an object (which is actually the ShippingMethodDto), so you can store that ShippingMethodDto as an instance field for later use. 

#208390
Oct 23, 2019 9:33
Vote:
 

Hi Quan,

I also though the load object method would be called when loading shipping methods in the commerce manager I also thought the savechanges method would fire when saving a shipping method or updating a shipping method. But they do not. I have attached to the IIS process and set a break point against both methods which do not get hit.

#208392
Oct 23, 2019 10:17
Vote:
 

Hi Quan,

Have you had a chance to look into this one? The load method does not get hit on load. The save method does not get hit on saving a new shipping method. The only way we can see to add a new row to the shipping method table is by sending Episerver a script to insert it into the DB. 

#208631
Oct 29, 2019 11:01
Vote:
 

Hi James, 

I'd imagine the ConfigureShippingMethods.ascx has been added to the wrong location in the solution maybe, and thats why its not being found and used in your example. 

You've probably already done so, but I'd suggest going through the steps under the section "Adding a configuration tab", here:

https://world.episerver.com/documentation/developer-guides/commerce/shipping/Shipping-gateways-and-providers/

These two steps are especially important:

  • Add a reference to your shipping provider method in the Commerce Manager project, if this has not been done.
  • Copy the ConfigurateShippingMethod.ascx into a new folder under the Shared folder location Apps/Order/Shipping/Plugins/Shipping Method Name. The shipping method name does not have to be the name of the shipping provider; it can be more informational, representing a shipping provider or shipping type, for example, FedEx24Hour.

I had the same teething issues when setting up a custom provider previously. 

Hope it helps!

Paul 

#208647
Oct 29, 2019 15:32
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.