$woocommerce->cart is null inside WordPress Rest API
Yes, this is true because WooCommerce cart is only initialized on the front-end (or if it’s a front-end request): But it fails because $woocommerce->cart is always null. So in WooCommerce 3.6.4 (current release as of writing) or later, you can manually initialize the cart like so: // Load cart functions which are loaded only on … Read more