• Resolved bounceonline

    (@bounceonline)


    Hello,

    We are experiencing a large volume of PHP warnings whenever shipping rates associated with Flexible Shipping are enabled.

    The error is:

    PHP Warning: array_sum(): Addition is not supported on type string in /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-shipping-method.php on line 316

    Environment:

    • WordPress: 6.8.1
    • WooCommerce: 9.9.5
    • PHP: 8.3
    • Flexible Shipping: 10.9.4
    • Server: LiteSpeed with MariaDB

    Our shipping zone contains:

    1. A Flexible Shipping method called “Tiered Shipping”
    2. A native Local Pickup method called “Collect from Shop (Ferndale)”, with the Flexible Shipping Rules Table additional-cost option

    The warning has appeared more than 116,000 times. To isolate it, we conducted the following tests:

    • Both methods enabled: warnings occur continuously.
    • Tiered Shipping disabled, Flexible Shipping-enhanced Local Pickup enabled: 37 warnings were generated in approximately four minutes.
    • Local Pickup disabled, Tiered Shipping enabled: 40 warnings were generated in approximately two and a half minutes.
    • Both methods disabled: no array_sum() warnings were generated during the subsequent test period.

    The Tiered Shipping rates are numeric and based on cart price. The Local Pickup method has a base cost of R0 and previously used the Flexible Shipping Rules Table to add R50 below a specified cart value.

    This suggests that one or more Flexible Shipping calculations may be passing WooCommerce a cost array containing an empty or non-numeric string. WooCommerce then calls array_sum() on that array.

    Could you please confirm:

    1. Whether this is a known compatibility issue with PHP 8.3 or our WooCommerce version
    2. Whether Flexible Shipping may return an empty string within the shipping-cost array
    3. Whether an update or recommended configuration change resolves it
    4. Whether you need a diagnostic log showing the method ID and contents of the cost array

    I can provide screenshots, a WooCommerce System Status report and a sanitised log excerpt.

    Kind regards,

    Chris

    The page I need help with: [log in to see the link]

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

    (@grzegorzturbasa)

    Hi Chris,
    thank you for sharing your problem. Can you please send mentioned details (screenshots, a WooCommerce System Status report and a sanitised log excerpt) to help@octolize.com? These will help to replicate your scenario.

    I would appreciate if you could include the link to this thread to reference it on our side.

    Kind regards,
    Greg

    Plugin Author grzegorzturbasa

    (@grzegorzturbasa)

    Dince there are no new replies I’m marking this thread as resolved.

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

You must be logged in to reply to this topic.