No products in the cart.
WooCommerce DHL Express – Show Free Shipping and Express Shipping in Europe and Hide Express Shipping Out of Europe
This is a business case request from a customer using ELEX WooCommerce DHL Express / eCommerce / Paket Shipping Plugin with Print Label. The DHL plugin has Economy services and also the Express services, and a few more other services available. This customer wanted to use only two types of services – Economy Select and Express Shipping. The DHL Economy Select shipping rates are cheaper compared to DHL Express Shipping.The customer wanted to offer the Economy services as Free shipping for all countries, and offer Express shipping as an option only within Europe. Other regions outside Europe he wanted to offer Economy Select option as Free shipping, and no Express Shipping option.
When he enabled the Economy Select and Express Shipping option, it shows both for all regions, and also the Economy Select that he wanted to show as Free shipping had a shipping cost returned by DHL API. This happens since the DHL plugin is designed to fetch real time shipping cost based on weight and dimension of the package and destination address and not to offer Free shipping or Flat Rate shipping.
Arriving at a solution
One workaround would be to add price adjustment of -100% Under the ‘Rates and services’ tab in the plugin settings for the Economy Select shipping options. However, it would show the shipping cost as 0$ for Economy Select which is not really ideal. So the best solution here is to add WooCommerce Free Shipping method and rename it as Economy Select. And for the Express Shipping option, enable it for all regions and hide DHL option for countries outside Europe.
In this article I’ll explain in detail how to use the Show hide shipping method plugin which is free of cost, and also set up the WooCommerce Shipping Zones, and the services required to be enabled in the DHL plugin to achieve this business case. The screenshot below shows how the current cart page looks like with the DHL Express and Economy Select option, and shipping is calculated for Europe or any other countries.
Let’s first see the requirements to set up this case.
1. WooCommerce Free Shipping Method:
You need to add a shipping zone in WooCommerce > Shipping > Shipping Zones, and name it ‘everywhere’. Leave the country selection so that it will apply to all countries. Add a Free Shipping method and name it as ‘DHL Economy Select’. This option will be available for all countries including Europe and outside Europe. Make sure you go to cart page and check if the free shipping option is showing fine.
You need to purchase the plugin from our site, and set up the plugin to get the shipping rates. To set up the DHL plugin and retrieve the shipping rates, you need to get the API credentials from DHL team. For DHL Express, you need to open account and register in https://xmlportal.dhl.com and DHL will provide the Test and Live API credentials. Depending on which set of credentials you received you need to enable/disable the ‘Show DHL Account Rates‘ option under the Rates and services tab in the plugin settings. For Test credentials you need to disable the ‘Show DHL Account Rates‘ option, and for live credentials you need to enable the ‘Show DHL Account Rates’ option.
Make sure all your products (simple and variations) have weight and dimension in them. You can add weight and dimension while editing the product. Go to shipping tab under the product data and fill up the fields ‘Weight‘,’Length‘,’Width‘ and ‘Height/Thickness‘. The plugin requires these data to calculate shipping and the packing option in the plugin settings. Once done, enable the DHL Express services in the plugin settings under the ‘Rates and Services Tab’ with the product code ‘N’ for Express Domestic, ‘P’ for Express Worldwide, ‘D’ also Express Worldwide (doc type) and U also Express Worldwide (doc type). Different countries require different services, and so depending on the requirement the API will automatically return rates for one of the above services. Now, check if you’re getting the DHL shipping options in the Cart page. If you’re not getting any shipping rates, please make sure you have the address correct or contact our support team.
3. Show hide Shipping Method Plugin
The DHL Express option is still showing even for countries outside Europe, and the customer wanted to offer only Free shipping (renamed as Economy Select) for the countries outside Europe and hide the Express option. So to hide DHL Express for outside Europe, you’ll have to install our Show Hide Shipping Method Plugin.
Getting this to work
For this to work, you can define another WooCommerce shipping zone with all countries except European countries. Go to WooCommerce > Settings > Shipping > Shipping Zones > Add a Shipping zone. Instead of adding countries one by one you can just select the continents such as Africa, Asia, North America, South America, Australia, Antarctica. And if there are few countries or islands not included in the continent list, then you can add them separately to the list. Also add Free Shipping method for this zone and rename it to DHL Economy Select, so that when the address falls under this zone, instead of Everywhere option, they’ll get the Free shipping option.
Once the shipping zone is set, configure the Show/Hide Shipping Method plugin to hide DHL services for Non- EU Shipping Zone. Go to WooCommerce > Settings > Manage Shipping Methods and define the rule by selecting Non- EU Shipping zone under the Shipping Zones, and under the Shipping ID add ‘wf_dhl_shipping’ as shown below.
This will hide DHL Express option for all countries outside Europe and show Free Shipping as DHL Economy Select.
This solution will work if you want to have Flat Rate shipping option instead of the Free Shipping. You just need to configure flat rate shipping instead of the free shipping in the WooCommerce shipping zones. Or, if you want to use a similar solution for our other shipping plugins you can do so. Just make sure you enter the correct shipping IDs while configuring the shipping ID in the Show Hide shipping methods plugin or under the ‘Manage shipping methods’ settings. To get the shipping ID of the services, showing in the cart or checkout page, you can right click the shipping option in the Cart page and select Inspect. And in the console that shows up, the element details will already been selected so you can see the shipping ID under “value”. This you can copy and enter the same in the Show Hide shipping method in the shipping ID field.
Hope this article has helped you with your requirements. You can always contact our support team and reply to this article directly if you have any queries or business cases that need a solution. You can share them with us, and if we have a possible solution using our plugins, we will get back to you pretty soon.
To explore more details about the shipping plugins, please check out the product pages.
- ELEX WooCommerce DHL Express / eCommerce / Paket Shipping Plugin with Print Label,
- ELEX WooCommerce Australia Post Shipping Plugin with Print Label & Tracking,
- ELEX WooCommerce USPS Shipping Plugin with Print Label,
- ELEX Stamps.com Shipping Plugin with USPS Postage for WooCommerce,
- ELEX EasyPost (FedEx, UPS & USPS) Shipping & Label Printing Plugin for WooCommerce
You can also check out other WooCommerce and WordPress plugins in ELEX.