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

#   allow order only with specific quanties

##

- **[Teto](/forum/user/8045-teto "View Teto's Profile")**
- [![Teto's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar8045_2012-09-12.png)](/forum/user/8045-teto "View Teto's Profile") Topic Author
- [ Offline](/forum/user/8045-teto)

Less More

- Posts: 184
- Thank you received: 4
-
- [](http://www.madeinvino.com)
-

14 years 2 months ago [\#60489](#60489) by [Teto](/forum/user/8045-teto "View Teto's Profile")  *[allow order only with specific quanties](/forum/4-how-to/60489-allow-order-only-with-specific-quanties#60489 "Good evening! For some categories we fixed the minimum quantity to 6 (throught the standard field of hika) For these categories we would like to allow the users the buy only in multiple of 6: 6 bottles 12 18 24 Do you think is possible? Thank you!")* was created by *[Teto](/forum/user/8045-teto "View Teto's Profile")*

Good evening!
For some categories we fixed the minimum quantity to 6 (throught the standard field of hika)
For these categories we would like to allow the users the buy only in multiple of 6:
6 bottles
12
18
24
Do you think is possible?
Thank you!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNDg5LWFsbG93LW9yZGVyLW9ubHktd2l0aC1zcGVjaWZpYy1xdWFudGllcz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

14 years 2 months ago [\#60506](#60506) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: allow order only with specific quanties](/forum/4-how-to/60489-allow-order-only-with-specific-quanties#60506 "Good evening! For some categories we fixed the minimum quantity to 6 (throught the standard field of hika) For these categories we would like to allow the users the buy only in multiple of 6: 6 bottles 12 18 24 Do you think is possible? Thank you!")*

Hi,

Thanks to views, you can modify the "quantity" view in order to display a dropdown list instead of the classical input text field.
After that, if you want more "security", you can add some checks in the "checkout step" view to check products' quantities.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNDg5LWFsbG93LW9yZGVyLW9ubHktd2l0aC1zcGVjaWZpYy1xdWFudGllcz90bXBsPW1hcmtkb3du) or [Create an account](/register) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

14 years 2 months ago [\#60507](#60507) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: allow order only with specific quanties](/forum/4-how-to/60489-allow-order-only-with-specific-quanties#60507 "Good evening! For some categories we fixed the minimum quantity to 6 (throught the standard field of hika) For these categories we would like to allow the users the buy only in multiple of 6: 6 bottles 12 18 24 Do you think is possible? Thank you!")*

You might also be able to do it more simply:
One simple way is to enter the price for 6 bottles and consider the product as a pack of six bottles.
Another way is to create a characteristic for the number of bottles and in each variant of the product enter the corresponding price.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNDg5LWFsbG93LW9yZGVyLW9ubHktd2l0aC1zcGVjaWZpYy1xdWFudGllcz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Teto](/forum/user/8045-teto "View Teto's Profile")**
- [![Teto's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar8045_2012-09-12.png)](/forum/user/8045-teto "View Teto's Profile") Topic Author
- [ Offline](/forum/user/8045-teto)

Less More

- Posts: 184
- Thank you received: 4
-
- [](http://www.madeinvino.com)
-

14 years 2 months ago -  14 years 2 months ago [\#60508](#60508) by [Teto](/forum/user/8045-teto "View Teto's Profile")  Replied by *[Teto](/forum/user/8045-teto "View Teto's Profile")* on topic *[Re: allow order only with specific quanties](/forum/4-how-to/60489-allow-order-only-with-specific-quanties#60508 "Good evening! For some categories we fixed the minimum quantity to 6 (throught the standard field of hika) For these categories we would like to allow the users the buy only in multiple of 6: 6 bottles 12 18 24 Do you think is possible? Thank you!")*

Thank you both for your help.

I would like to show the price of the single bottle and the characteristic should suit the purpose.
I defined the characteristic "package", and the value are 6 bottles, 12, 18.
I was able to define different prices for them.
Unfortunately Hika considers them like different items, and for this reason the stock is considered different.
In my case the stock is always the same, and I need to show and decrease it like before.
Do you have any ideas?

Otherwise I can try to modify the view, could you please give me some little suggestions to modify the code?

Thanks.

Last edit: 14 years 2 months ago by [Teto](/forum/user/8045-teto "View Teto's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNDg5LWFsbG93LW9yZGVyLW9ubHktd2l0aC1zcGVjaWZpYy1xdWFudGllcz90bXBsPW1hcmtkb3du) or [Create an account](/register) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

14 years 2 months ago [\#60591](#60591) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: allow order only with specific quanties](/forum/4-how-to/60489-allow-order-only-with-specific-quanties#60591 "Good evening! For some categories we fixed the minimum quantity to 6 (throught the standard field of hika) For these categories we would like to allow the users the buy only in multiple of 6: 6 bottles 12 18 24 Do you think is possible? Thank you!")*

If you want to have the stock handled on a per bottle basis, you won't be able to use a characteristic for the selection.
In that case you should create a quantity display override and not use characteristics:
[ www.hikashop.com/en/forum/4-how-to/15254...uantity-ordered.html](http://www.hikashop.com/en/forum/4-how-to/15254-restricting-quantity-ordered.html)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNDg5LWFsbG93LW9yZGVyLW9ubHktd2l0aC1zcGVjaWZpYy1xdWFudGllcz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Teto](/forum/user/8045-teto "View Teto's Profile")**
- [![Teto's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar8045_2012-09-12.png)](/forum/user/8045-teto "View Teto's Profile") Topic Author
- [ Offline](/forum/user/8045-teto)

Less More

- Posts: 184
- Thank you received: 4
-
- [](http://www.madeinvino.com)
-

14 years 2 months ago [\#60600](#60600) by [Teto](/forum/user/8045-teto "View Teto's Profile")  Replied by *[Teto](/forum/user/8045-teto "View Teto's Profile")* on topic *[Re: allow order only with specific quanties](/forum/4-how-to/60489-allow-order-only-with-specific-quanties#60600 "Good evening! For some categories we fixed the minimum quantity to 6 (throught the standard field of hika) For these categories we would like to allow the users the buy only in multiple of 6: 6 bottles 12 18 24 Do you think is possible? Thank you!")*

so i have to:
1) create a file templates/YOUR_TEMPLATE/html/hikashop_button.php with the code indicated
2) For the cart/checkout, i need to edit the cart file of the views checkout and product and change the code which displays the input field.

am i right?
could you give more details for the point 2?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNDg5LWFsbG93LW9yZGVyLW9ubHktd2l0aC1zcGVjaWZpYy1xdWFudGllcz90bXBsPW1hcmtkb3du) or [Create an account](/register) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

14 years 2 months ago [\#60684](#60684) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: allow order only with specific quanties](/forum/4-how-to/60489-allow-order-only-with-specific-quanties#60684 "Good evening! For some categories we fixed the minimum quantity to 6 (throught the standard field of hika) For these categories we would like to allow the users the buy only in multiple of 6: 6 bottles 12 18 24 Do you think is possible? Thank you!")*

The simplest is to change the line:
&lt;input id="hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;" type="text" name="item[&lt;?php echo $row-&gt;cart_product_id;?&gt;]" class="hikashop_product_quantity_field" value="&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;" onchange="var qty_field = document.getElementById('hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field){&lt;?php echo $input; ?&gt;}" /&gt;

to:
&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;

so that the user cannot change the quantities on the checkout.

You can also transform that line to a select.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzYwNDg5LWFsbG93LW9yZGVyLW9ubHktd2l0aC1zcGVjaWZpYy1xdWFudGllcz90bXBsPW1hcmtkb3du) or [Create an account](/register) 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.084 seconds

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