How to Get Shipping Rates with WooCommerce DHL Express Plugin for Cities with no ZIP Code

This is a business case related to requests from various customers using ELEX WooCommerce DHL Express / eCommerce / Paket Shipping Plugin with Print Label

The problem

The DHL plugin provides real-time rates with the help of DHL API. DHL API requires various destination address fields such as Country, State, City, and Zip Code to provide the rates. But some of our customers reported that they are not getting the correct shipping rates or no shipping rates for some UAE cities, as UAE has no zip code fields and DHL was not able to provide the rates for these few cities.

Arriving at a solution

The basic solution was to provide WooCommerce flat rates for the UAE region and generate a label through the backend. But this required a lot of manual effort and was not a financially viable solution. So, our product development team came up with a solution, which can be implemented easily and is a perfect solution on the basis of shipping charges.

In this case study, you will get to know how we helped our customers to ship using DHL to the UAE region without any trouble. Please see the below screenshot where you can see that we are not getting any DHL rates for Nad Al Hammar city in Dubai.

As per the screenshot, we are not getting any rates. So, we have added the below code snippet in the functions.php file of the theme folder to take State as City to get the rates.

add_filter('elex_dhl_send_state_as_city_to_api','elex_dhl_send_state_as_city_to_api_fun');
function elex_dhl_send_state_as_city_to_api_fun () {
return array('AE');
}

In the above code snippet, you can see that we have added the United Arab Emirates (AE). Like this, you can add other countries to get the rates for cities that do not have a zip code.

After adding the code snippet, we are getting the rates for Nad Al Hammar. See the below image:

This way, we have solved this critical shipping case for our UAE customers. Now they are shipping successfully with our plugin.

Please visit the Product Page of ELEX WooCommerce DHL Express / eCommerce / Paket Shipping Plugin with Print Label to find the full set of features and capabilities.

To know what our customers are talking about WooCommerce DHL shipping plugin, please check customer reviews.

    Leave a Reply

    WordPress Image Lightbox Plugin