• Resolved lockedm

    (@lockedm)


    Hi, we’re using the Weight Based Pricing for WooCommerce by ThemeParrot. It’s a food site and some line items are in grams and KGs. When an order is is split that contains a weight based line item, get a fatal error with:

    Current plugin: Order Splitter for WooCommerce (version 5.3.6)
    PHP version 8.1.33 Error Details

    An error of type E_ERROR was caused in line 4744 of the file /home/xxx/public_html/wp-content/plugins/woo-order-splitter/inc/functions.php. Error message: Uncaught DivisionByZeroError: Division by zero in /home/xxx/public_html/wp-content/plugins/woo-order-splitter/inc/functions.php:4744
    Stack trace: 0 /home/xxx/public_html/wp-content/plugins/woo-order-splitter/inc/functions.php(3769): wc_os_order_splitter->clone_order_items() 1 /home/xxx/public_html/wp-content/plugins/woo-order-splitter/inc/functions.php(379): wc_os_order_splitter->cloned_order_data() 2 /home/xxx/public_html/wp-includes/class-wp-hook.php(341): wc_os_order_splitter->clone_order() 3 /home/xxx/public_html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters() 4 /home/xxx/public_html/wp-includes/plugin.php(522): WP_Hook->do_action() 5 /home/xxx/public_html/wp-settings.php(742): do_action() 6 /home/xxx/public_html/wp-config.php(123): require_once(‘/home/xxx…’) 7 /home/xxx/public_html/wp-load.php(50): require_once(‘/home/xxx…’) 8 /home/xxx/public_html/wp-admin/admin.php(35): require_once(‘/home/xxx…’) 9 /home/xxx/public_html/wp-admin/edit.php(10): require_once(‘/home/xxx…’) 10 {main} thrown

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Thank you for reporting this issue and for the detailed error information.
    The problem was caused by a zero-quantity line item generated by weight-based pricing, which could trigger a division by zero under PHP 8+.
    This has now been fixed in the next release.

    Much appreciated for bringing this to our attention.

    Thread Starter lockedm

    (@lockedm)

    Wow! thanks for the very quick response and fix. I’ll install the updated version and report back if I still encounter any issues.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.