• I was trouble shooting with WP_DEBUG on.
    Issue:
    Creation of dynamic property WC_Order_Item_Fee::$legacy_fee is deprecated in /plugins/woocommerce/includes/class-wc-checkout.php on line 568

    Creation of dynamic property WC_Order_Item_Fee::$legacy_fee_key is deprecated in /plugins/woocommerce/includes/class-wc-checkout.php on line 569

    The deprecated warnings you’re seeing are related to the dynamic properties WC_Order_Item_Fee::$legacy_fee and WC_Order_Item_Fee::$legacy_fee_key, which are being triggered when adding fees during the checkout process in WooCommerce. These properties have been deprecated since WooCommerce 4.4.0.

    Particularly in the class Orderable_Tip_Pro_Checkout (class-tip-pro-checkout.php), the following actions likely trigger the deprecated properties:

    • checkout_apply_tip() and handle_apply_tip_on_checkout_block(): Both functions add fees using WC()->cart->add_fee(). This can cause the deprecated dynamic properties in WooCommerce to be created.
    • update_percentage_tip(): When recalculating percentage-based fees, it manipulates the fees using WC()->cart->fees_api()->set_fees(). This may also indirectly trigger the creation of the deprecated properties.

    Solution: The plugin should update how it adds and manages fees to avoid triggering deprecated WooCommerce properties. Instead of using WC()->cart->add_fee(), the correct approach is to use the WC_Cart_Fees_API class (WC()->cart->fees_api()) to handle fee additions and updates. This will ensure compatibility with newer versions of WooCommerce and PHP.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support kennethbryanlim

    (@kennethbryanlim)

    Hi @jpollie,

    Thank you for reaching out and bringing this to our attention.

    I will be forwarding this to our development team for further investigation, and we will get back to you once we have received any insights from them.

    Thank you!

    Hi @jpollie,

    Thanks for your patience!

    Just letting you know that our team is looking into this, so we can fix it in the following releases.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.