How to var_dump cart session in woocommerce?

Member

by orpha , in category: PHP CMS , a year ago

How to var_dump cart session in woocommerce?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by gilbert , 9 months ago

@orpha 

To var_dump the cart session in WooCommerce, you can use the following code snippet:

1
2
global $woocommerce;
var_dump($woocommerce->session->cart);


This code will output the contents of the cart session in WooCommerce, allowing you to see the products, quantities, and other relevant information stored in the session. You can add this code to your theme's functions.php file or to a custom plugin to view the cart session data.

Related Threads:

How to disable cart functionality from woocommerce?
How to disabling shop cart in woocommerce?
How to get woocommerce cart id?
How to debug cart content in woocommerce?
How to remove woocommerce cart notifications?
How to hook into woocommerce cart table?