title: WooCommerce get_cart() on null
body: <p>Before I updated to <code>WC</code> at 4.3.1 ,I had this code and it worked well</p>
  <pre><code> add_action( 'rest_api_init', function () {
                      register_rest_route( 'px-module-woocommerce', '/px/cart', array(
                              'methods' =&gt; 'POST',
                              'callback' =&gt; array($this,'ajax_add_to_cart'),
                      ));
  });
  public function ajax_add_to_cart() {
         $items = WC()-&gt;cart-&gt;get_cart();
  }
  </code></pre>
  <p>now, <code>WC()-&gt;cart-&gt;get_cart()</code> still return</p>
  <pre><code>Call to a member function get_cart() on null
  </code></pre>
  <p>I also tried the global value <code>$woocommerce</code>. But, the result is still the same. Have you any solution? Thanks.</p>