• Resolved nemrio

    (@nemrio)


    Hi I’m seing this error happen too much about the

    PHP Deprecated: WC_Abstract_Legacy_Order::get_product_from_item est obsolète depuis la version 4.4.0?! Utilisez $item->get_product() à la place

    so I searched for it and I found that is still used here

    woocommerce/includes/legacy/abstract-wc-legacy-order.php:	public function get_product_from_item( $item ) {
    woocommerce/includes/legacy/abstract-wc-legacy-order.php:		wc_deprecated_function( 'WC_Abstract_Legacy_Order::get_product_from_item', '4.4.0', '$item->get_product()' );
    woocommerce/includes/legacy/abstract-wc-legacy-order.php:		return apply_filters( 'woocommerce_get_product_from_item', $product, $item, $this );
    woocommerce/includes/class-wc-order-item-product.php:		// Backwards compatible filter from WC_Order::get_product_from_item().
    woocommerce/includes/class-wc-order-item-product.php:		if ( has_filter( 'woocommerce_get_product_from_item' ) ) {
    woocommerce/includes/class-wc-order-item-product.php:			$product = apply_filters( 'woocommerce_get_product_from_item', $product, $this, $this->get_order() );
    woocommerce-services/classes/class-wc-connect-compatibility-wc26.php:			return $order->get_product_from_item( $item );
    woocommerce-services/classes/class-wc-connect-taxjar-integration.php:				$product        = $order->get_product_from_item( $item );

    Can you take a look and if possible to provide an update thanks !

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @nemrio

    It looks like your site is calling a function that was deprecated in WooCommerce 4.4.0.

    This can be from a plugin or your theme, so I’d recommend doing a conflict test.

    The best way to do this is:

    • Temporarily switch your theme to Storefront
    • Disable all plugins except for WooCommerce
    • Repeat the action that is causing the problem

    If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated.

    To figure out which plugin is causing the problem, reactivate your other plugins one by one, testing after each, until you find the one causing conflict.

    You can find a more detailed explanation on how to do a conflict test here.

    My very best!

    André

    (@chiape)

    Hi @nemrio!

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Deprecated: WC_Abstract_Legacy_Order::get_product_from_item’ is closed to new replies.