Skip to content
Advertisement

WooCommerce get_cart() on null

Before I updated to WC at 4.3.1 ,I had this code and it worked well

JavaScript

now, WC()->cart->get_cart() still return

JavaScript

I also tried the global value $woocommerce. But, the result is still the same. Have you any solution? Thanks.

Advertisement

Answer

I solved including the functions which are loaded only on the front-end.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement