4

I was wondering what happened to my Woocommerce or something after I updated the plugin. Some deprecation error occurs. Kindly see attached image below. How can I solved this thing? enter image description here

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399

2 Answers2

6

1) You need to replace WC_Cart::get_checkout_url it with wc_get_checkout_url() instead, without using WC()->cart (or WC_Cart::) as it's not a WC_Cart method anymore.

2) For WC_Cart->fees, you can replace it with WC_Cart->get_fees() or WC()->cart->get_fees();

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
0

In the page of source code https://docs.woocommerce.com/wc-apidocs/source-class-WC_Cart.html#636-645, you can see

   /**
     * Gets the url to the cart page.
     *
     * @deprecated 2.5.0 in favor to wc_get_cart_url()
     *
     * @return string url to page
     */
    public function get_cart_url() {
        return wc_get_cart_url();
    }

Use the wc_get_cart_url().

Den
  • 1
  • 1