• Please replace WC()->cart->get_item_data by wc_get_formatted_cart_item_data in side-cart-woocommerce/public/partials/xoo-wsc-content.php.

    WC()->cart->get_item_data function is deprecated since version 3.3 from Woocommerce.

    Thanks

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m having the same issue.

    The error in the error_log file reads:

    The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.

    It only seems to randomly effect site, but when it does, I get a blank page with a “This page isn’t working” error (in Chrome).

    Hi @xootixsupport ,

    I wrote a few months ago and wanted to check to see if the “The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.” issue was ever resolved?

    I’m still having it. Please @xootixsupport, correct it!

    Champdor

    I’m also getting this very annoying error, please fix it!

    [Mon Dec 10 21:13:44.156582 2018] [proxy_fcgi:error] [pid 30344:tid 139935570900736] [client 151.67.41.170:52068] AH01071: Got error ‘PHP message: The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.\nPHP message: The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.\nPHP message: The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.\nPHP message: The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.\nPHP message: The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.\nPHP message: The WC_Cart::get_item_data function is deprecated since version 3.3. Replace with wc_get_formatted_cart_item_data.\n’

    Please re-download the plugin & check.

    Thank you!

    this is the fix.
    A version check and a direct call to wc_get_formatted_cart_item_data.
    I had tried to substitute get_item_data with wc_get_formatted_cart_item_data as
    WC()->cart->wc_get_formatted_cart_item_data and didn’t work. Obviously!
    Ok, this seems to solve it at last. Frankly it didn’t cause any trouble on the front-end but those error logs looked nasty and had to debug a payment gateway callback issue and these errors had to be removed.
    Perhaps you should add a batch upgrade to 1.0.3.

    xoo-wsc-content.php
    // Meta data
    if(version_compare( WC()->version , ‘3.3.0’ , “<” )){
    $attributes .= WC()->cart->get_item_data( $cart_item );
    }
    else{
    $attributes .= wc_get_formatted_cart_item_data( $cart_item );
    }

    • This reply was modified 6 years, 3 months ago by floyd0987.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Deprecated function WC()->cart->get_item_data’ is closed to new replies.