• Resolved ghost994

    (@ghost994)


    Hi Tabby team đź‘‹,

    After updating my site to PHP 8.1 (with WordPress 6.x and WooCommerce), I noticed the following warning in my error logs when placing an order:

    PHP Warning: WC_Tabby::woocommerce_checkout_order_processed(): Argument #3 ($order) must be passed by reference, value given in /home/xxxx/public_html/wp-includes/class-wp-hook.php on line 324 Root cause

    In your plugin file:
    /wp-content/plugins/tabby-checkout/includes/class-wc-tabby.php

    The function is currently defined as:

    public function woocommerce_checkout_order_processed( $order_id, $posted_data, &$order ) { ... }

    WooCommerce passes the $order object by value, not by reference.
    PHP 8.x is stricter and throws a warning because of the & (pass-by-reference). Suggested fix

    Simply remove the reference & in the function definition:

    public function woocommerce_checkout_order_processed( $order_id, $posted_data, $order ) { ... }

    This change makes the plugin compatible with PHP 8+ and WooCommerce’s current hook signature. ⚠️ Notes

    • The warning doesn’t break checkout, but it clutters error logs.
    • It’s best to patch this in the official release, so users don’t have to manually edit plugin files.
Viewing 1 replies (of 1 total)
  • Plugin Author tabbyai

    (@tabbyai)

    Dear @ghost994,

    Thank you for bringing this to our attention.

    We’d like to inform you that the latest plugin version (v5.7.4) includes the necessary fixes to address the issue you mentioned.

    Please let us know if you have any further questions or need assistance with the update.
    For any technical inquiries, you can also reach out to our integrations team at [email protected].

    Best regards,
    Tabby Team

Viewing 1 replies (of 1 total)

The topic ‘Add support for PHP 8.x’ is closed to new replies.