Hikashop DHL Shipping not working

  • Posts: 4
  • Thank you received: 1
1 month 1 week ago #365422

-- HikaShop version -- : HikaShop Business 5.1.3
-- Joomla version -- : 5.2.3
-- PHP version -- : 8.2.27
-- Error-message(debug-mod must be tuned on) -- : Warning: Undefined array key "documents" in /usr/www/users/plugins/hikashopshipping/dhl/dhl.php on line 1187

Warning: foreach() argument must be of type array|object, null given in /usr/www/users/plugins/hikashopshipping/dhl/dhl.php on line 1187

Hello,

I bought the Hikashop DHL Shipping for use it in Germany, but after several tries it’s not working.

For not working i mean that :
- the shipping method I’ve created using the Hikashop DHL Shipping does not show up as option in the cart
- does not transmit/export the data to the DHL portal as it should do.

Activating the full debug, I can see these errors

Warning: Undefined array key "documents" in /usr/www/users/plugins/hikashopshipping/dhl/dhl.php on line 1187

Warning: foreach() argument must be of type array|object, null given in /usr/www/users/plugins/hikashopshipping/dhl/dhl.php on line 1187

Configuring another shipping method with the HikaShop manual shipping plugin, it works fine, so I would exclude issues with the products configuration.

Could anyone help or have experience with the DHL plugin for use in Germany?

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 83397
  • Thank you received: 13489
  • MODERATOR
1 month 1 week ago #365423

Hi,

Thanks for your feedback on the warning messages with the debug activated. We're going to improve the code in a future version to not have them. You can ignore them for now as they don't change anything for the functioning of the plugin.

The first thing is to have the DHL shipping method(s) appearing during the checkout.
If you don't get any, you won't be able to select one with your order, and thus, the plugin won't export the order to DHL since that only apply for orders with DHL selected as a shipping method.

Now, there are many reasons which can lead to a DHL shipping method not appearing during the checkout while the manual shipping method(s) you've configured appear. For once, you need to fill in the specific configuration fields as per the DHL shipping plugin documentation:
www.hikashop.com/support/documentation/5...op-shipping-dhl-form
For example, if the address information is incomplete or incorrect, or if the API credentials / account number are missing, the plugin won't be able to retrieve the rates from DHL.
Also, the products need to have their weight AND dimensions filled in. This is necessary for DHL to be able to calculate the rates based on the specificities of the package to be sent, while it is not necessary for the manual shipping method(s). So please check this too.

A good way to find what is missing is to disable the other shipping methods and only leave the DHL one published. Then, on the checkout, you'll get an error message explaining what the problem is with the DHL plugin if no shipping method is available.

Another way is to activate the "debug" setting of the shipping method, reproduce the issue and finally look at the "payment log file" setting of the HikaShop configuration. It will contain debug information for the plugin at the end which should tell you / us what is wrong. But normally, you shouldn't have to go that far. The checkout should be able to tell you already as I explained above.

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 1
1 month 1 week ago #365432

Thank you for your quick answer and hints :-)

I’ve enabled now only the DHL shipping method and I see again the error “no shipping method is available” with this warning:

Warning: Undefined array key "products" in /usr/www/users/web/plugins/hikashopshipping/dhl/dhl.php on line 597

Warning: foreach() argument must be of type array|object, null given in /usr/www/users/web/plugins/hikashopshipping/dhl/dhl.php on line 597


All the configuration data inside the plugin were correct also before….but is still not working.

I’m searching now for the “payment log file” but can’t find it; could you tell me in which folder is it?

Thanks again

Please Log in or Create an account to join the conversation.

  • Posts: 83397
  • Thank you received: 13489
  • MODERATOR
1 month 1 week ago #365437

Hi,

These warnings indicates that the plugin sent a request to DHL to get the available rates but DHL didn't return any rates without returning any error.
That's a case we didn't get in our tests and no one reported so far.

The debug information should allow us to better understand what's going on.
As I said, the payment log file is available in the HikaShop configuration page. Here:
www.hikashop.com/support/documentation/5...nfig.html#main_files

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 1
1 month 1 week ago #365447

Thank you :-) :-) :-) It seems from the logs that something is wrong with the credentials......I'm investigating

Attachments:
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 1
1 day 45 minutes ago #366099

Hi,

I did really many tests and together with DHL support from Germany, and I came out with these results.

Maybe this plugin was developed for another country (?), but to work in Germany it needs:
two additional fields for the authentication
API url is different from the pre-configured
Product codes are also different from the pre-configured

Here in short what is needed for the authentication and the correct API url:

curl --location ' api-eu.dhl.com/parcel/de/shipping/v2 ' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'client_id=(API's username OK)' \
--data-urlencode 'client_secret=(API's password OK)' \
--data-urlencode 'username=(Missing field username)' \
--data-urlencode 'password=(Missing field password)'

Example of Germany’s products code.

array('key' => 14, 'code' => 'V01PAK', 'name' => 'DHL Paket'),
array('key' => 15, 'code' => 'V53WPAK', 'name' => 'DHL Paket International'),
array('key' => 16, 'code' => 'V54WPAK', 'name' => 'DHL Europaket'),
array('key' => 17, 'code' => 'V62KP', 'name' => 'DHL Kleinpaket'),
array('key' => 18, 'code' => 'V66WPI', 'name' => 'Warenpost International'),

Would it possible to
- add the missing field for the authentication (username and password) ?
- change the API url field (or make it configurable from the user) ?
- change the shipping code (or make them configurable from the user) ?

Thanks again!

Please Log in or Create an account to join the conversation.

  • Posts: 83397
  • Thank you received: 13489
  • MODERATOR
21 hours 22 minutes ago #366101

Hi,

The modifications you're talking about are for this API:
developer.dhl.com/api-reference/parcel-d...ge_content_entity=en
This API is completely different from the API developer.dhl.com/api-reference/dhl-expr...ge_content_entity=en which our DHL plugin is based on.
So, just adding product codes and credentials fields won't be enough. The plugin just cannot work with the API "DHL Parcel DE Shipping". A whole new plugin would have to be developed from scratch. And even if we did, it would be a lot more limited because it doesn't seems that it has any capability to calculate shipping rates automatically. So it would require entering shipping rates manually on your end, unless I'm missing something ?

I'm surprised you can't use the "DHL Express - MyDHL API" API used by our plugin. The documentation page of the API clearly says that it can be used "globally", and "region: global".
However, it does says you need a "Express customer account". While your API says that it is for "Business customers of Post & Parcel Germany".
So maybe the issue is that you're trying to use our plugin with a DHL "Business account", and the solution would be to just create a DHL "Express customer account" on your end to be able to use the plugin ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.067 seconds
Powered by Kunena Forum