title: Notice: Trying to get property 'subtotal' of non-object
body: <p>hello i add this <a href="https://stackoverflow.com/a/70959249/1173200">code</a> in my child theme and i got</p>
  <blockquote>
  <p>Notice: Trying to get property 'subtotal' of non-object</p>
  </blockquote>
  <p>for this line <code>if( WC()-&gt;cart-&gt;subtotal &gt; 500 ){</code>
  why and how can i fix this?</p>