[Skip to main content](#vessel-content)

#   Limit order quantity to multiple of minimum order

##

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

8 years 6 months ago [\#292465](#292465) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  Replied by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")* on topic *[Limit order quantity to multiple of minimum order](/forum/35-orders-management/866240-limit-order-quantity-to-multiple-of-minimum-order?start=20#292465 "-- HikaShop version -- : Essential 2.2.3 -- Joomla version -- : 3.2.1 -- PHP Version 5.3.27  I have a food product priced at $20 per 100g, and the minimum order quantity is 300g. Also I need to limit the order quantity to multiples of the minimum order. i.e. customer's orders can only be 300g, 600g, 900g and up.  Setting &quot;Price&quot; = 20; &quot;Minimum quantity per order&quot; = 3 can only limit the order quantity starting at 300g. I would like to modify the &quot;+&quot; and &quot;-&quot; buttons so that each press of the buttons will increase/decrease the order quantity by the value of the &quot;minimum quantity per order&quot;, here is 3 in this example.")*

Hi Jerome, we were studying how to implement you comment. However it is not clear for what you meant by

> Jerome wrote: Afterwards, you can use product custom fields or category custom fields to store such kind of value.

Could you elaborate?

Thanks, James

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg2NjI0MC1saW1pdC1vcmRlci1xdWFudGl0eS10by1tdWx0aXBsZS1vZi1taW5pbXVtLW9yZGVyP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

8 years 6 months ago [\#292467](#292467) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limit order quantity to multiple of minimum order](/forum/35-orders-management/866240-limit-order-quantity-to-multiple-of-minimum-order?start=20#292467 "-- HikaShop version -- : Essential 2.2.3 -- Joomla version -- : 3.2.1 -- PHP Version 5.3.27  I have a food product priced at $20 per 100g, and the minimum order quantity is 300g. Also I need to limit the order quantity to multiples of the minimum order. i.e. customer's orders can only be 300g, 600g, 900g and up.  Setting &quot;Price&quot; = 20; &quot;Minimum quantity per order&quot; = 3 can only limit the order quantity starting at 300g. I would like to modify the &quot;+&quot; and &quot;-&quot; buttons so that each press of the buttons will increase/decrease the order quantity by the value of the &quot;minimum quantity per order&quot;, here is 3 in this example.")*

Hi,

It's simple. Create a custom field of the table "product" and for each product, enter the value you want for the "mod" in that field.
Then, in the view file, instead of replacing the 1 by 6 as I explained in my previous message, you can use instead $this-&gt;row-&gt;XXX where XXX is the column name of the custom field.
And that way, you'll have different increments for different products.

The following user(s) said Thank You: [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg2NjI0MC1saW1pdC1vcmRlci1xdWFudGl0eS10by1tdWx0aXBsZS1vZi1taW5pbXVtLW9yZGVyP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

8 years 6 months ago [\#292498](#292498) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  Replied by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")* on topic *[Limit order quantity to multiple of minimum order](/forum/35-orders-management/866240-limit-order-quantity-to-multiple-of-minimum-order?start=20#292498 "-- HikaShop version -- : Essential 2.2.3 -- Joomla version -- : 3.2.1 -- PHP Version 5.3.27  I have a food product priced at $20 per 100g, and the minimum order quantity is 300g. Also I need to limit the order quantity to multiples of the minimum order. i.e. customer's orders can only be 300g, 600g, 900g and up.  Setting &quot;Price&quot; = 20; &quot;Minimum quantity per order&quot; = 3 can only limit the order quantity starting at 300g. I would like to modify the &quot;+&quot; and &quot;-&quot; buttons so that each press of the buttons will increase/decrease the order quantity by the value of the &quot;minimum quantity per order&quot;, here is 3 in this example.")*

That is perfectly clear now. Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg2NjI0MC1saW1pdC1vcmRlci1xdWFudGl0eS10by1tdWx0aXBsZS1vZi1taW5pbXVtLW9yZGVyP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")**
- [![jameswadsworth's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")
- [ Offline](/forum/user/556-jameswadsworth)

Less More

- Posts: 274
- Thank you received: 5
-
-
-
- [](http://www.deanimaconsulting.com)
-

8 years 3 months ago [\#296491](#296491) by [jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")  Replied by *[jameswadsworth](/forum/user/556-jameswadsworth "View jameswadsworth's Profile")* on topic *[Limit order quantity to multiple of minimum order](/forum/35-orders-management/866240-limit-order-quantity-to-multiple-of-minimum-order?start=20#296491 "-- HikaShop version -- : Essential 2.2.3 -- Joomla version -- : 3.2.1 -- PHP Version 5.3.27  I have a food product priced at $20 per 100g, and the minimum order quantity is 300g. Also I need to limit the order quantity to multiples of the minimum order. i.e. customer's orders can only be 300g, 600g, 900g and up.  Setting &quot;Price&quot; = 20; &quot;Minimum quantity per order&quot; = 3 can only limit the order quantity starting at 300g. I would like to modify the &quot;+&quot; and &quot;-&quot; buttons so that each press of the buttons will increase/decrease the order quantity by the value of the &quot;minimum quantity per order&quot;, here is 3 in this example.")*

I'm replying to explain what we did in case it is useful to others. In our case fortunately the minimum order quantity is always the multiple by which we want to increase the quantity. Is if the minimum quantity is 1, then 1,2,3,4,5,6,7 etc. If 6 then 6,12,18,24,30,36 etc.

We copied the file view /product/show_quantity.php to frontend template override. We grabbed the variable $min_quantity and we replace every occurrence of data-dac-qty-mod="1" with data-dac-qty-mod="&lt;?php echo $min_quantity; ?&gt;" and data-dac-qty-mod="-1" with data-dac-qty-mod="-&lt;?php echo $min_quantity; ?&gt;"

Now when we use the plus and minus button the quantities increase by the required quantities.

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg2NjI0MC1saW1pdC1vcmRlci1xdWFudGl0eS10by1tdWx0aXBsZS1vZi1taW5pbXVtLW9yZGVyP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[ericdewaal](/forum/user/57169-ericdewaal "View ericdewaal's Profile")**
- [![ericdewaal's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/57169-ericdewaal "View ericdewaal's Profile")
- [ Offline](/forum/user/57169-ericdewaal)

Less More

- Posts: 26
- Thank you received: 1
-
-

7 years 7 months ago [\#305888](#305888) by [ericdewaal](/forum/user/57169-ericdewaal "View ericdewaal's Profile")  Replied by *[ericdewaal](/forum/user/57169-ericdewaal "View ericdewaal's Profile")* on topic *[Limit order quantity to multiple of minimum order](/forum/35-orders-management/866240-limit-order-quantity-to-multiple-of-minimum-order?start=20#305888 "-- HikaShop version -- : Essential 2.2.3 -- Joomla version -- : 3.2.1 -- PHP Version 5.3.27  I have a food product priced at $20 per 100g, and the minimum order quantity is 300g. Also I need to limit the order quantity to multiples of the minimum order. i.e. customer's orders can only be 300g, 600g, 900g and up.  Setting &quot;Price&quot; = 20; &quot;Minimum quantity per order&quot; = 3 can only limit the order quantity starting at 300g. I would like to modify the &quot;+&quot; and &quot;-&quot; buttons so that each press of the buttons will increase/decrease the order quantity by the value of the &quot;minimum quantity per order&quot;, here is 3 in this example.")*

Hi, we have this problem too and so far opted for the "Show select" option in the configuration/product options.
Reason is that, although the buttons work perfectly in this mod, the customer can input any number, which is no multiple of the minimum quantity, manually without the using the buttons.
Or change the number in the cart afterwards.
In a competing Joomla webshop, they have this setup too but check all input with javascript onchange and round it to multiples.
Maybe an idea?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg2NjI0MC1saW1pdC1vcmRlci1xdWFudGl0eS10by1tdWx0aXBsZS1vZi1taW5pbXVtLW9yZGVyP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

7 years 7 months ago [\#305898](#305898) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limit order quantity to multiple of minimum order](/forum/35-orders-management/866240-limit-order-quantity-to-multiple-of-minimum-order?start=20#305898 "-- HikaShop version -- : Essential 2.2.3 -- Joomla version -- : 3.2.1 -- PHP Version 5.3.27  I have a food product priced at $20 per 100g, and the minimum order quantity is 300g. Also I need to limit the order quantity to multiples of the minimum order. i.e. customer's orders can only be 300g, 600g, 900g and up.  Setting &quot;Price&quot; = 20; &quot;Minimum quantity per order&quot; = 3 can only limit the order quantity starting at 300g. I would like to modify the &quot;+&quot; and &quot;-&quot; buttons so that each press of the buttons will increase/decrease the order quantity by the value of the &quot;minimum quantity per order&quot;, here is 3 in this example.")*

Hi,

There is no "step" system. The "show select" system allows for it by not allowing something else to be selected. But actually, should you temper with the HTML of the dropdown, you could add other values than the increments. And its the same with the javascript check.
A proper solution would be to add an extra option in the products to enter the increment and check the quantity both during the add to cart, the loading of the cart, and also add javascript for inputs to check on that.
Now the show select solution and other tricks discussed here seem to be good enough for most situations, so I'm not usre it would warant all that complex development. And adding a small custom check in javascript on the quantity input field would be easy for any developer should you need it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg2NjI0MC1saW1pdC1vcmRlci1xdWFudGl0eS10by1tdWx0aXBsZS1vZi1taW5pbXVtLW9yZGVyP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.065 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
