In a master static product -Adding minimum quantity of all items selected

Modified on Wed, Aug 14 at 11:52 AM

add this code to the Main Layout of the product 


<script>
         function _initAddToCart()
         {
             var minQtyTot = 12;
             var iQtyTot = 0;
             $( ".ep-input-sub-product-qty" ).each(function() {
               iQtyTot += parseInt($(this).val());
             });
             
             if (iQtyTot < minQtyTot) 
             {
                 //alert("A minimum total quantity of " + minQtyTot + "      is required.")
                 $("#spanMsg").html("<p>A minimum total quantity      of " + minQtyTot + " is required.</p>");
                 return false;
             }
             return true;
         }
     </script>

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article