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

#   Quantity Box

##

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

Less More

- Posts: 36
- Thank you received: 0
-
-

15 years 11 months ago [\#2091](#2091) by [coober](/forum/user/353-coober "View coober's Profile")  *[Quantity Box](/forum/4-how-to/2091-quantity-box#2091 "Hello,  first time posting and I have a question about quantity boxes.  Is it possible to show a quantity box for some items and not for others.  thanks David")* was created by *[coober](/forum/user/353-coober "View coober's Profile")*

Hello,

first time posting and I have a question about quantity boxes.

Is it possible to show a quantity box for some items and not for others.

thanks
David

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIwOTEtcXVhbnRpdHktYm94P3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 11 months ago [\#2093](#2093) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Quantity Box](/forum/4-how-to/2091-quantity-box#2093 "Hello,  first time posting and I have a question about quantity boxes.  Is it possible to show a quantity box for some items and not for others.  thanks David")*

Hi,

If you set the quantity of a product to 0, the add to cart button and the quantity box will be removed.

If you just wan to display the quantity box and keep the add to cart button for all the product, you can change the configuration option "Display the quantity field on the product page" under the tab display.

But if you want to do it only for some products, you will have to change the code of the view. You can go to Display-&gt;Views and edit the file show of the view product. There, you can use the code
$this-&gt;params-&gt;set('show_quantity_field',0);
to hide it, and the code
$this-&gt;params-&gt;set('show_quantity_field',1);
to show it.

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

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

Less More

- Posts: 36
- Thank you received: 0
-
-

15 years 11 months ago [\#2152](#2152) by [coober](/forum/user/353-coober "View coober's Profile")  Replied by *[coober](/forum/user/353-coober "View coober's Profile")* on topic *[Re: Quantity Box](/forum/4-how-to/2091-quantity-box#2152 "Hello,  first time posting and I have a question about quantity boxes.  Is it possible to show a quantity box for some items and not for others.  thanks David")*

Thanks nicolas

do I just add this code

$this-&gt;params-&gt;set('show_quantity_field',0);
to hide it, and the code
$this-&gt;params-&gt;set('show_quantity_field',1);
to show it.

anywhere to the file?

thanks
David

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIwOTEtcXVhbnRpdHktYm94P3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 11 months ago [\#2153](#2153) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Quantity Box](/forum/4-how-to/2091-quantity-box#2153 "Hello,  first time posting and I have a question about quantity boxes.  Is it possible to show a quantity box for some items and not for others.  thanks David")*

You need to add your code before the quantity layout loading code: Code:

$this-&gt;setLayout('quantity'); echo $this-&gt;loadTemplate();

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

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

Less More

- Posts: 36
- Thank you received: 0
-
-

15 years 11 months ago [\#2154](#2154) by [coober](/forum/user/353-coober "View coober's Profile")  Replied by *[coober](/forum/user/353-coober "View coober's Profile")* on topic *[Re: Quantity Box](/forum/4-how-to/2091-quantity-box#2154 "Hello,  first time posting and I have a question about quantity boxes.  Is it possible to show a quantity box for some items and not for others.  thanks David")*

is this correct?

}
?&gt;&lt;span id="hikashop_product_quantity_main" class="hikashop_product_quantity_main"&gt;&lt;?php
$this-&gt;row =&amp; $this-&gt;element;
$this-&gt;params-&gt;set('show_quantity_field',1);
$this-&gt;setLayout('quantity');
echo $this-&gt;loadTemplate();
?&gt;
&lt;/span&gt;

to show the quantity box

and

}
?&gt;&lt;span id="hikashop_product_quantity_main" class="hikashop_product_quantity_main"&gt;&lt;?php
$this-&gt;row =&amp; $this-&gt;element;
$this-&gt;params-&gt;set('show_quantity_field',0);
$this-&gt;setLayout('quantity');
echo $this-&gt;loadTemplate();
?&gt;
&lt;/span&gt;

to hid it.

thanks
David

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIwOTEtcXVhbnRpdHktYm94P3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 11 months ago [\#2156](#2156) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Quantity Box](/forum/4-how-to/2091-quantity-box#2156 "Hello,  first time posting and I have a question about quantity boxes.  Is it possible to show a quantity box for some items and not for others.  thanks David")*

Yes.

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

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

Less More

- Posts: 36
- Thank you received: 0
-
-

15 years 11 months ago [\#2158](#2158) by [coober](/forum/user/353-coober "View coober's Profile")  Replied by *[coober](/forum/user/353-coober "View coober's Profile")* on topic *[Re: Quantity Box](/forum/4-how-to/2091-quantity-box#2158 "Hello,  first time posting and I have a question about quantity boxes.  Is it possible to show a quantity box for some items and not for others.  thanks David")*

thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzIwOTEtcXVhbnRpdHktYm94P3RtcGw9bWFya2Rvd24=) 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.072 seconds

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