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

#   Show stock if there are 10 products or less in stock

##

- **[vaughan](/forum/user/12479-vaughan "View vaughan's Profile")**
- [![vaughan's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar12479.jpg)](/forum/user/12479-vaughan "View vaughan's Profile") Topic Author
- [ Offline](/forum/user/12479-vaughan)

Less More

- Posts: 71
- Thank you received: 0
-
-

8 years 10 months ago [\#286415](#286415) by [vaughan](/forum/user/12479-vaughan "View vaughan's Profile")  *[Show stock if there are 10 products or less in stock](/forum/26-product-category-display/893556-show-stock-if-there-are-10-products-or-less-in-stock#286415 "-- url of the page with the problem -- :   wpb.es/calendario/listado-de-rodadas/pro...cos-navarra-8-3-2018  -- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.8.3 -- PHP version -- : 7.0  Hi  How can I hide stock count, and only show if there are 10 products or less in stock  I'm trying with this code in Views/product/quantity but don't change anything  Original code:  Could you help me?")* was created by *[vaughan](/forum/user/12479-vaughan "View vaughan's Profile")*

-- url of the page with the problem -- : [ wpb.es/calendario/listado-de-rodadas/pro...cos-navarra-8-3-2018](http://wpb.es/calendario/listado-de-rodadas/producto/797-los-arcos-navarra-8-3-2018)
-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.8.3
-- PHP version -- : 7.0

Hi

How can I hide stock count, and only show if there are 10 products or less in stock

I'm trying with this code in Views/product/quantity but don't change anything
Code:

&lt;span class="hikashop_product_stock_count"&gt; &lt;?php if($this-&gt;row-&gt;product_quantity &lt;= 10) echo (($this-&gt;row-&gt;product_quantity &lt;= 10 &amp;&amp; JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK') ? JText::sprintf('X_ITEM_IN_STOCK', $this-&gt;row-&gt;product_quantity) : JText::sprintf('X_ITEMS_IN_STOCK', $this-&gt;row-&gt;product_quantity)); elseif(!$in_stock) echo JText::_('NO_STOCK'); ?&gt; &lt;/span&gt;

Original code: Code:

&lt;span class="hikashop_product_stock_count"&gt; &lt;?php if($this-&gt;row-&gt;product_quantity == 1) echo (($this-&gt;row-&gt;product_quantity == 1 &amp;&amp; JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK') ? JText::sprintf('X_ITEM_IN_STOCK', $this-&gt;row-&gt;product_quantity) : JText::sprintf('X_ITEMS_IN_STOCK', $this-&gt;row-&gt;product_quantity)); elseif(!$in_stock) echo JText::_('NO_STOCK'); ?&gt; &lt;/span&gt;

Could you help me?

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

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

Less More

- Posts: 4820
- Thank you received: 652
-
-

8 years 10 months ago -  8 years 10 months ago [\#286450](#286450) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[Show stock if there are 10 products or less in stock](/forum/26-product-category-display/893556-show-stock-if-there-are-10-products-or-less-in-stock#286450 "-- url of the page with the problem -- :   wpb.es/calendario/listado-de-rodadas/pro...cos-navarra-8-3-2018  -- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.8.3 -- PHP version -- : 7.0  Hi  How can I hide stock count, and only show if there are 10 products or less in stock  I'm trying with this code in Views/product/quantity but don't change anything  Original code:  Could you help me?")*

Hello,

This forum aim is to help and guide in your custom you, and so I can only advice you to **analyze data available on this HikaShop View**.
Maybe by using a Code:

var_dump($this);

That will allow you to see that you don't check the good value, because "Code:

product_quantity

" isn't the quantity but a **boolean about the option to display quantity or not (0)**.

Hope you will achieved what you plan.
Regards

Last edit: 8 years 10 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

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

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