• Resolved llgreg

    (@llgreg)


    Hello,

    Getting the following error on the website and think I’ve traced it down to the following template files

    Error message

    The WC_Cart::get_cart_url function is deprecated since version 2.5. Replace with wc_get_cart_url.

    Using this command
    find . -iname '*php' | xargs grep ' get_cart_url' -sl

    I get the following results

    ./wp-content/plugins/woocommerce-bulk-order-form/includes/standard-template-add-to-cart-handler.php
    ./wp-content/plugins/woocommerce-bulk-order-form/includes/class-frontend.php
    ./wp-content/plugins/woocommerce-bulk-order-form/includes/variation-template-add-to-cart-handler.php
    ./wp-content/plugins/woocommerce/includes/legacy/class-wc-legacy-cart.php

    Is it possible to update the plugin so it uses the new wc_get_cart_url function please?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    If you check those files you’ll see that we only use that for backwards compatibility:

    
    if ( version_compare( WOOCOMMERCE_VERSION, '2.5.2', '>=' ) ) {
    	return wc_get_cart_url();
    } else {
    	global $woocommerce;
    	return $woocommerce->cart->get_cart_url();
    }
    

    Did you also check your theme folder? Additionally I would suggest to search for ->get_cart_url instead of get_cart_url, this may give more (better) results.

    Thread Starter llgreg

    (@llgreg)

    Thanks, managed to find it in another plugin.

    Thanks again for your help on this and your quick response.

    where was the problem, and how did you solve it

    Thread Starter llgreg

    (@llgreg)

    Hi @jesusromero,

    I used the suggestion that Ewout highlighted, searching for
    ->get_cart_url and found it in a different plugin.

    Failing that try and disable the theme, or plugins one by one to try and locate it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘The WC_Cart::get_cart_url function is deprecated since version 2.5.’ is closed to new replies.