Webinar Recap - Adding real-time shipping rates to Kentico

   —   

I recently presented a Partner Webinar on Adding real-time shipping rates to Kentico. As a former developer in the industry I often had to add this functionality to the ecommerce projects I worked on. As such, I thought it would make a great topic for other partners and demonstrate a few different ways to add dynamic rates to your online stores.

Webinar Link

View Webinar

Documentation Links

I wanted to provide you with some helpful links that I reference in my presentation.

Kentico Documentation - Implementing custom shipping carrier providers

Kentico Documentation - Creating custom modules

Kentico Documentation - Configuring shipping carriers

Carrier / Tool Links

FedEx
 
UPS
 
USPS
 

In the webinar I discussed using dotNETShip for my MultiCarrier provider. This is a low-cost utility for shipping rates I have used for several sites over the past 10 years. You can find more about this 3rd party utility below.

USPS

Source Code

Finally, here is the custom module and carrier files I created, if you need them.

RealTimeShipping.zip

 

I hope you enjoyed the webinar and the examples I demonstrated. Now go code some awesome stuff!

This blog is intended to demonstrate one of many ways to accomplish this task. Always consult the Kentico Documentation for best practices and additional examples.

Share this article on   LinkedIn

Bryan Soltis

Hello. I am a Technical Evangelist here at Kentico and will be helping the technical community by providing guidance and best practices for all areas of the product. I might also do some karaoke. We'll see how the night goes...

Comments

Bryan Soltis commented on

Hi Janet,
This webinar was a Partner Webinar and only available to those users. If you are a Kentico Partner, you can find the video in the Partner Portal (partner.kentico.com) under Resources / Recorded Webinar.

janet.putnam-surya commented on

When I click on the link for the webinar I get an "access to the page" error. Is this link still good. Thanks,

Bryan Soltis commented on

Hi. I'm looking into your "single page not calculating" issue with our internal developers. The issue is that the current Customer Address control does not pass / set the zip code until it's submitted. In the case of a single-page checkout, this presents an issue of having the data accessible. The reason the control works the way it does currently is to handle some tax calculations based on the state selected.

In order to get the functionality you need, you should be able to to accomplish it by copying the CusterAddress.ascx web part and modifying the addreewssFormControlLoad method with the following:

NOTE: You will need to be on the latest hotfix so the control has that method already defined.

void addressFormControlLoad(object sender, EventArgs e)
{
if (CurrentCartAddress == null)
{
return;
}

// Get selected state from country selector in UIForm
var countrySelectorControl = addressForm.FieldControls["AddressCountryID"];
var addressStateID = countrySelectorControl != null ? countrySelectorControl.GetOtherValue("AddressStateID") : null;
// Get selected country from UIForm
var addressCountryId = addressForm.GetFieldValue("AddressCountryID");

CurrentCartAddress.AddressCountryID = ValidationHelper.GetInteger(addressCountryId, CurrentCartAddress.AddressCountryID);
CurrentCartAddress.AddressStateID = ValidationHelper.GetInteger(addressStateID, 0);

//New code to add set additional fileds
AddressInfo address = addressForm.EditedObject as AddressInfo;
CurrentCartAddress.AddressLine1 = ValidationHelper.GetString(addressForm.GetFieldValue("AddressLine1"), "");
CurrentCartAddress.AddressZip = ValidationHelper.GetString(addressForm.GetFieldValue("AddressZip"), "");


ShoppingCart.InvalidateCalculations();
ComponentEvents.RequestEvents.RaiseEvent(null, e, SHOPPING_CART_CHANGED);
}


That should get you the values you need. If not, let me know and I will keep looking into it!

- Bryan

wdaugherty-dataspringinc commented on

Thank you for the response, I was able to log in with our partner credentials and start watching. However I do have a question. We are implementing custom carriers and we are trying to use the CanDeliver method to determine if the service should be in the dropdown. However the delivery address is not fully populated. As part of the requirements the ship method is on the same page of the checkout sequence as the shipping address. We set the flag to propagate on change and the only data that comes through is the country and state. Have you worked with this and is there a better way to do it and yet still meet the customers requirements? Because we are hooking to a live call we don't want to make the call if we do not have a shipping zip code.

Bryan Soltis commented on

Hi William,
You will need to a be a Kentico Partner in order to view the view as it was part of the Partner Webinar Series.
- Bryan

William commented on

The link for the webinar takes me to an access denied page.