• Resolved khaiser

    (@khaiser)


    Hi,

    I’m getting a fatal error on my site (hosted on Cloudways) coming from this plugin:

    PHP Fatal error: Uncaught TypeError: Unsupported operand types: int + string in
    /wp-content/plugins/woo-ultimate-order-combination/inc/functions.php:666

    This looks like a PHP 8+ compatibility issue: the code at line 666 is adding an integer and a string with the + operator, and one of the values is apparently not numeric (e.g. an empty string or null). On PHP 7.x this would just throw a warning and treat the string as 0, but on PHP 8+ it’s a fatal TypeError.

    Could you take a look at line 666 of inc/functions.php and add a proper type cast ((int)/(float)) or an is_numeric() check before the addition?

    Environment:

    • WordPress + WooCommerce (Cloudways hosting)
    • PHP version: 8.3
    • Plugin version: 2.0.6

    Happy to provide more details (full stack trace, steps to reproduce) if needed.

    Thanks!

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

    (@fahadmahmood)

    Hi,

    Thank you for reporting this and for providing the details. I’ve identified the PHP 8+ compatibility issue and fixed it by properly handling the tax values as numeric amounts.

    I’m releasing a new version of the plugin with this fix included. Please update to the latest version and let me know if you encounter any further issues.

    Thanks again for reporting it!

    Thread Starter khaiser

    (@khaiser)

    Following up on the previous fatal error I reported (which you fixed — thank you).

    I’m now getting a new fatal error, but only on combined orders (orders created via your plugin’s combination feature). Regular orders are unaffected.

    Uncaught TypeError: Cannot access offset of type string on string in
    /wp-content/plugins/e-transactions-wc/templates/admin/order/payment-info.php:44

    The failing code is:

    php

    foreach ( $transactions as $transaction ):
        if(empty($transaction_number)){
            $transaction_number = $transaction['captured'] ? $transaction['numtrans'] : $transaction['auth_numtrans'];
        }

    $transactions comes from an order meta field maintained by the e-transactions-wc payment plugin — normally an array of associative arrays, each describing one payment transaction (captured, numtrans, auth_numtrans, amount, card_type, etc.). On combined orders, at least one entry in this array ends up being a plain string instead of an associative array, which causes the fatal TypeError on PHP 8+.

    This strongly suggests that when combining orders, the plugin doesn’t preserve the internal structure of this payment gateway meta — it’s likely copied/merged as if it were a simple value, instead of being handled as a structured array coming from another plugin.

    Could you check how order meta belonging to other plugins (not just WooCommerce core order data) is copied when combining orders — specifically whether serialized/array meta values are preserved correctly, rather than being flattened or concatenated as strings?

    Environment:

    • WordPress + WooCommerce (Cloudways hosting)
    • PHP version: 8.3
    • Plugin version: 2.0.7
    • Payment gateway: e-transactions-wc

    Thanks!

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    I just released an improved version. Please try it and see if the issue is fixed. If it still doesn’t work, please use the Contact Developer option under the Help tab on the settings page so I can troubleshoot the issue with you more effectively.

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

You must be logged in to reply to this topic.