I am trying to get minimum order quantity in single product page. If someone want to purchase the product and put the quantity of the product which he/she want to buy.

But if the quantity is less than the minimum order quantity then there will generate a warning, in which the minimum amount of quantity is mentioned. For single product page i am using view.phtml file which is a custom created file and i want to get minimum order quantity of particular product in this file.

Please help me.


  • you can set from admin in product details page for minimum qty Dec 1 '16 at 11:36
  • I am asking for get the quantity. Already set from backend. minimum order quantity want to show in frontend .
    – Yudi
    Dec 1 '16 at 11:38
  • @Yudi Check my updated answer. Dec 1 '16 at 12:10
  • @chirag this is not what i was asking. that's why....
    – Yudi
    Dec 9 '16 at 9:16
  • You can check and try this magento 2 minimum order quantity per product module it will help to solve the issues Jun 18 at 6:54

Go to Store > Configuration > Catalog > Inventory > Product Stock Option enter image description here

in that set Minimum Qty Allowed in Shopping Cart it will automatically display minimum quantity on your product page.

enter image description here

You can also set minimum quantity for a particular product. go to Product > Edit Product > Advanced Setting >Advanced Inventory

enter image description here

  • Thanks @chirag. It will allow minimum 5 items in our cart. But If i have simple product associated with configurable product, in which only one simple product have minimum order quantity and other don't have. Then in that case if customer want to purchase other simple product (without have minimum order quantity). Then for those product also minimum order quantity will again 5. And i don't want that. I want to get the minimum quantity which i have set to particular product from backend not for all of the product.
    – Yudi
    Dec 1 '16 at 11:51
  • check my updated answer Dec 1 '16 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.