Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

This topic contains 6 replies, has 1 voice.

Last updated by Andreas W. 6 days, 2 hours ago.

Assisted by: Andreas W..

Author Posts
January 28, 2025 at 10:54 am #16641065

lasseC-2

The issue is not simply assigning a user as "SE - Forhandler," but rather what happens when a user browses the site while being assigned this role.

Issue Summary:
When a user with the role "SE - Forhandler" logs in and tries to navigate the site, the site crashes with a fatal error.
The error occurs only when WooCommerce Multilingual & Multicurrency is active. If I disable this plugin, the issue disappears.

Error Details:
The error message states: "DivisionByZeroError: Division by zero in class-wcml-multi-currency-prices.php:427".

This suggests that WooCommerce Multilingual is trying to convert a price or shipping cost before a valid value has been set.

Reproduction Steps:
1. Log in as a user with the role "SE - Forhandler".
2. Browse the site.
3. The site crashes with the fatal error related to WooCommerce Multilingual.

What I Have Tested:
✔ Deactivating WPML Multicurrency → Site chrashes.
✔ Deactivating Shipmondo → Site works.
✔ Updating all plugins → No change.
✔ Testing on a staging site → Same issue occurs.

Next Steps:
Can you confirm if WPML Multicurrency is triggering the issue by trying to convert a price that has not yet been set?

Is there a way to prevent WooCommerce Multilingual from attempting to convert shipping costs before they exist?

January 28, 2025 at 11:30 am #16641391

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

My apologies, but I did not experience such an issue on the staging. On which page does it throw the fatal error?

Please give it a quick test and let me know if and exactly how you recreate the issue.

January 28, 2025 at 12:22 pm #16641597

lasseC-2

The issue occurs when a user with the role "SE - Forhandler" is logged in and browses the site.

Steps to Reproduce the Issue:
1. Log in as a user with the role "SE - Forhandler" (e.g., the "b2bking" test user I have set up).
2. Navigate to hidden link.
3. The site crashes with the DivisionByZeroError from WooCommerce Multilingual.

Key Observations:
- The issue only occurs when logged in as "SE - Forhandler".
- If I log in as a regular customer, the site works fine.
- The fatal error is caused by WCML Multi-Currency, as disabling this plugin resolves the issue.

Can you please log in as a "SE - Forhandler" user, browse the site, and confirm if you experience the same crash?

Let me know if you need any additional details.

January 28, 2025 at 4:08 pm #16643062

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I was able to see the error now and it seems to be triggered inside Shipmondo once the plugin evaluates costs and calculates shipping prices:

apply_filters()
wp-content/plugins/pakkelabels-for-woocommerce/plugin/shipping-methods/class.shipmondo.php:246

ShipmondoForWooCommerce\P\S\Shipmondo::evaluate_cost()
wp-content/plugins/pakkelabels-for-woocommerce/plugin/shipping-methods/class.shipmondo.php:459

ShipmondoForWooCommerce\P\S\Shipmondo::getShippingPrice()
wp-content/plugins/pakkelabels-for-woocommerce/plugin/shipping-methods/class.shipmondo.php:334

ShipmondoForWooCommerce\P\S\Shipmondo::calculate_shipping()
wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-shipping-method.php:257

Further, disabling B2BKing PRO solves the error.

This seems to be a complex compatibility issue between B2BKing PRO, Shipmondo and WCML.

To assist you on this matter we need to be able to recreate the issue on a test site (which we will provide) to confirm if this is a general issue.

After that, I will escalate the issue internally for further revision by the compatibility team.

The issue here is, that we can not test the plugin without having a paid Shipmondo plan and sadly Shipmondo is not yet one of our partners.

Would you be able to install the Shipmondo and the B2BKing plugins in their latest available version on a test site which I will provide, so that we can try to recreate the issue and work on a solution?

We need to take this step to confirm if we ar handling a general issue.