UPS Kentico Connector

kuntesh thakker asked on April 1, 2015 09:53

Hi Everyone ,

Please help me out to choose right way to Integrate UPS Connector and to show real time shipping methods at Kentico Check Out Page. Customizing ShippingInfoProvidor i think will help me out but i need to modify the GetShipping Method . Please Assist !!

Recent Answers

Suneel Jhangiani answered on April 1, 2015 12:47

I actually was thinking about this as I have been wondering about the best way given about what you have said through the previous threads.

One of the issues is that the ShippingOption chosen should be stored in the Kentico database as that is assigned to the order once the purchase process is completed within Kentico. Given what you have said about the service being based on Address and Products this makes it quite tricky as services can't be predefined as such (ie. user will select the service based on their order).

I'm still thinking that a Custom Carrier is the correct way to go, however, from that you would simply return 1 service (UPS Service). This would allow the user to select UPS Service as the ShippingOption in the select shipping option drop down. With that selected you would then display another Web Part which connects to the UPS website and retrieves the correct shipping information. I would do this by creating a new Class (UPSShippingOption) for holding some of the data. You would add an additional field to the Order class to hold the UPSShippingOptionId. This isn't a pre-populated class, but stores all the relevant information such that it could be displayed with the Order (ie. Service chosen). The UPSShippingOptionID field will only hold a reference when the UPS Shipping Option is chosen, so the field should allow nulls and will allow you to have other Shipping Options for your store.

You may be able to do reduce coding by inheriting from the SelectShipping web part and extending that such that if the ShippingOption matches the UPS Service it displays an additional dropdown with the choices available from UPS.You should check how the Shipping is selected in the Admin interface as well, so that a Store Administrator could edit the order and change the service chosen.

I feel doing it this way won't break any Kentico functionality and keep things easier when upgrading. It is also a flexible model in that it could be possible to package this for re-use on another site. It just depends on how you extend the ShippingSelector web part.

If you want the model to be truly flexible, you could isolate your UPS Shipping Service Selector webpart from the ShippingSelection web part. To do this you would subscribe to the wizard events using ComponentEvents.RequestEvents.RegisterForEvent(CMSCheckoutWebPart.SHOPPING_CART_CHANGED, your_update_function). This would also allow you to invalidate the existing UPS service selection when products are changed.

You should also be aware that during the purchase phase Kentico uses a ShoppingCart object, and only converts this to an Order object at the end. So if you are storing details you should ensure that automatically deleted ShoppingCart objects also delete any details you store.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.