Overview
- Set up live rates at checkout for Magento 2 and display your DHL Express shipping rates to your customers automatically.
About live rates at checkout
The destination address and the total weight of the cart are used to electronically return your DHL Express shipping rate. To take into account dimensions you will need to create custom attribute fields to store this information instructions can be found on Step 5.
Your customer can select the preferred shipping method and the order will be imported with this shipping method.
Rate Disclaimer
DHL’s Shipment charges are calculated according to the higher of actual or volumetric weight per piece and any piece may be re-weighed and re-measured by DHL to confirm this calculation. This may result in a higher price than displayed at the time of checkout.
- Prices quoted are estimates based on the information you have supplied.
- Prices quoted may not include duties, taxes, customs charges or all surcharges and fees.
- Transit time and price quotes are indicative and DHL has no liability or responsibility for differences between this indicative quote and the actual price or transit time.
- Your final transit time and price may differ based on the characteristics of the shipment, services requested and the packages actually tendered to DHL.
Plugin Disclaimer
While every effort has been made to ensure the accompanying plugin is as compatible as possible, many factors such as site customizations or conflicts with other third party plugins may result in the DHL plugin to behave unexpectedly or not function.
DHL offers no warranty or guarantee that plugins will operate for your specific site.
1. Install the extension app
Before installing any extension, please create a backup of the root folder of the Magento website and of the database.
- Download the Magento 2 extension file.
- Unpack the dhlexpress-services-3.0.0.zip file you've downloaded.
- Connect to the server where the website source folder is located with FTP/SFTP/SSH client.
- Upload all files and folders that you have unpacked to the root folder of your Magento website.
- Connect to your Magento directory with SSH.
- Run the following commands:
- php bin/magento setup:upgrade
- php bin/magento setup:di:compile
- php bin/magento setup:static-content:deploy
2. Generate your API key
- In DHL Express Commerce, go to Settings > API.
- If the API Key field is blank, click Regenerate, then click Save.
- Copy the API key. You will need to paste this into your Magento Admin panel.
3. Add your API key in Magento 2
- Go to your Magento Admin Dashboard, select Stores.
- Under Settings, select Configuration.
- Select Sales, then click Shipping Methods and select DHL Rates from the list.
- Set Enabled to Yes.
- Paste your API key in the API Key field.
- Fill in the required fields according to your preferences.
- Click Save Config.
4. Set Checkout Rates calculation method
- Go to Settings > Checkout Rates
-
Select an option on how rates are calculated
-
Single Package using sum of integration item weights
- Ignore any dimensions passed through from your ecommerce platform and total up the weight of all items in 1 package.
-
Single Package using sum of integration item weights and integration item dimensions
- Total up all item weights and dimensions from your ecommerce platform into 1 Package.
- Total up all item weights and dimensions from your ecommerce platform into 1 Package.
-
Single Package using default package weight and default dimensions
- Ignore weights and dimensions from ecommerce platforms and always use the 1 default package set up in Settings > Package Setup
- Ignore weights and dimensions from ecommerce platforms and always use the 1 default package set up in Settings > Package Setup
-
Unique Package for each item using integration item weights and integration item dimensions
- Treat each item in the basket as a unique package, take the dimensions and weights of each item and apply to its own Package. For example 5 items in the basket will be treated as 5 individual packages rather than a single package.
-
Single Package using sum of integration item weights
Your checkout should now display your live rates.
5. Set up dimension attributes for products
How to use dimensions for live rates
DHL Express Commerce supports dimensions for live rates at checkout for Adobe Commerce. To start using dimensions, you will need to create custom attributes in your Adobe Commerce store.
To create a custom attribute:
- Open your Adobe Commerce admin panel.
- Navigate to Stores > Attributes > Product.
- Click the Add New Attribute button.
- Create the following custom attributes using the exact spelling (not case-sensitive) under the Attribute Label field:
- Length
- Height
- Width
- Leave the Catalog input Type as Text Field.
- Click Save Attribute for each attribute.
All custom attributes created for one product will also be created for all products as empty fields. If the fields are empty or if the customer sets a non-numeric character in the dimension, DHL Express Commerce will assume the value as zero when getting rates.
Once the attributes are added, live rates using dimensions will be available to customers immediately.
Troubleshooting
Rates are showing higher than expected
In your DHL Express Commerce account, some configuration may be required to correctly identify the weights supplied by Magento in their API. Please follow the steps below:
- Go to Settings > Options.
- Under Rates at Checkout Weight Unit, set the value to Grams (g).
- Click Save.
- Retest the rates at checkout and validate if the rates are now correct.