title: Set minimum and maximum product quantity 2 pcs in specific product category in woocommerce woodmart theme
body: <p>I want to make minimum and maximum product quantity 2 pcs in specific product category of my site. That means customer can only buy any 2 products from that category</p>
  <p>Can someone fix me the following code?</p>
  <p>Code:</p>
  <p>add_action( 'woocommerce_check_cart_items', 'required_min_cart_subtotal_amount' );
  function required_min_cart_subtotal_amount() {</p>
  <p>// HERE Set minimum cart total amount</p>
  <pre><code>$minimum_amount = 200;
  </code></pre>
  <p>// Total (before taxes and shipping charges)</p>
  <pre><code>$cart_subtotal = WC()-&gt;cart-&gt;subtotal;
  </code></pre>
  <p>// Add an error notice is cart total is less than the minimum required</p>
  <pre><code>if( $cart_subtotal &lt; $minimum_amount  ) {
      
  </code></pre>
  <p>// Display an error message</p>
  <pre><code>    wc_add_notice( '&lt;strong&gt;' . sprintf( __(&quot;A minimum total purchase amount of %s is required to checkout.&quot;), wc_price($minimum_amount) ) . '&lt;strong&gt;', 'error' );
  }
  </code></pre>
  <p>}</p>