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

#   Products only available at the Store

##

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

Less More

- Posts: 23
- Thank you received: 1
-
-

7 years 9 months ago [\#303634](#303634) by [Genusskanzlei](/forum/user/30057-genusskanzlei "View Genusskanzlei's Profile")  *[Products only available at the Store](/forum/26-product-category-display/896882-products-only-available-at-the-store#303634 "-- url of the page with the problem -- :   www.genusskanzlei.at/  -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.1 -- PHP version -- : 7.2.12 -- Browser(s) name and version -- : Chrome  Hi  I have once programmed a condition that when we set the quantity to &quot;-2&quot;, with the help of a new constant 'IN&#95;STORE,' the front-end will display &quot;Available at the Store&quot; (Erhältlich im Geschäft) instead of &quot;out of stock.&quot;  After changing the Theme, this is not working anymore, and I have tried and failed to get it working right following your code source.  For example, when I look at the following category:   www.genusskanzlei.at/index.php/genusskan...egory/115-aufstriche  all the products display the standard 'NO&#95;STOCK' --&gt; &quot;Out of Stock&quot; (&quot;Nicht vorrätig&quot;)  However, when I view the product page, I do get the 'IN&#95;STORE' message but also the &quot;add to cart&quot;; which in this case shouldn't be displayed since they can only be ordered directly.  I edited the 'com&#95;hikashop/product/quantity.php' and changed:  to  I want the 'IN&#95;STORE' message to display in the &quot;listing views&quot; and that the &quot;add to cart&quot; options, does not show for this condition. How can I edit the code to achieve these results?  I hope I have made myself understood and you could help me fix this problem, which is misleading the clients.  Thanks a lot in advance!")* was created by *[Genusskanzlei](/forum/user/30057-genusskanzlei "View Genusskanzlei's Profile")*

-- url of the page with the problem -- : [ www.genusskanzlei.at/](https://www.genusskanzlei.at/)
-- HikaShop version -- : 4.0.2
-- Joomla version -- : 3.9.1
-- PHP version -- : 7.2.12
-- Browser(s) name and version -- : Chrome

Hi

I have once programmed a condition that when we set the quantity to "-2", with the help of a new constant 'IN_STORE,' the front-end will display "Available at the Store" (Erhältlich im Geschäft) instead of "out of stock."

After changing the Theme, this is not working anymore, and I have tried and failed to get it working right following your code source.

For example, when I look at the following category: [ www.genusskanzlei.at/index.php/genusskan...egory/115-aufstriche](https://www.genusskanzlei.at/index.php/genusskanzlei-produkte/category/115-aufstriche)
all the products display the standard 'NO_STOCK' --&gt; "Out of Stock" ("Nicht vorrätig")
[ ![products-listing.png](/forum/attachment/46082) ](/forum/attachment/46082 "...ts-listing.png")

However, when I view the product page, I do get the 'IN_STORE' message but also the "add to cart"; which in this case shouldn't be displayed since they can only be ordered directly.
[ ![product-view-quantity-value-2-after-editing-code.png](/forum/attachment/46080) ](/forum/attachment/46080 "...iting-code.png")

I edited the 'com_hikashop/product/quantity.php' and changed:
Code:

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

to
Code:

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

I want the 'IN_STORE' message to display in the "listing views" and that the "add to cart" options, does not show for this condition. How can I edit the code to achieve these results?

[ ![quantity&#95;value-2.png](/forum/attachment/46081) ](/forum/attachment/46081 "...ty&#95;value-2.png")

I hope I have made myself understood and you could help me fix this problem, which is misleading the clients.

Thanks a lot in advance!

- [ ![product-view-quantity-value-2-after-editing-code.png](/forum/attachment/46080) ](/forum/attachment/46080 "...iting-code.png") [ ](/forum/attachment/46080?download=1 "...iting-code.png")
- [ ![quantity&#95;value-2.png](/forum/attachment/46081) ](/forum/attachment/46081 "...ty&#95;value-2.png") [ ](/forum/attachment/46081?download=1 "...ty&#95;value-2.png")
- [ ![products-listing.png](/forum/attachment/46082) ](/forum/attachment/46082 "...ts-listing.png") [ ](/forum/attachment/46082?download=1 "...ts-listing.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTY4ODItcHJvZHVjdHMtb25seS1hdmFpbGFibGUtYXQtdGhlLXN0b3JlP3RtcGw9bWFya2Rvd24=) 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: 86363
- Thank you received: 14296
-
-

7 years 9 months ago [\#303661](#303661) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Products only available at the Store](/forum/26-product-category-display/896882-products-only-available-at-the-store#303661 "-- url of the page with the problem -- :   www.genusskanzlei.at/  -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.1 -- PHP version -- : 7.2.12 -- Browser(s) name and version -- : Chrome  Hi  I have once programmed a condition that when we set the quantity to &quot;-2&quot;, with the help of a new constant 'IN&#95;STORE,' the front-end will display &quot;Available at the Store&quot; (Erhältlich im Geschäft) instead of &quot;out of stock.&quot;  After changing the Theme, this is not working anymore, and I have tried and failed to get it working right following your code source.  For example, when I look at the following category:   www.genusskanzlei.at/index.php/genusskan...egory/115-aufstriche  all the products display the standard 'NO&#95;STOCK' --&gt; &quot;Out of Stock&quot; (&quot;Nicht vorrätig&quot;)  However, when I view the product page, I do get the 'IN&#95;STORE' message but also the &quot;add to cart&quot;; which in this case shouldn't be displayed since they can only be ordered directly.  I edited the 'com&#95;hikashop/product/quantity.php' and changed:  to  I want the 'IN&#95;STORE' message to display in the &quot;listing views&quot; and that the &quot;add to cart&quot; options, does not show for this condition. How can I edit the code to achieve these results?  I hope I have made myself understood and you could help me fix this problem, which is misleading the clients.  Thanks a lot in advance!")*

Hi,

If you had it working as view overrides for your previous template, then you could just copy the relevant files from templates/YOUR_OLD_TEMPLATE/html/com_hikashop/product to templates/YOUR_NEw_TEMPLATE/html/com_hikashop/product
and that should be enough.

Now the exact view file to edit and which change to do in that file will depend on how your website is configured, which I don't know.
To make sure that you're editing the correct file, you'll want to first temporarily activate the "display view files" setting of the HikaShop configuration and look at the product page. Once you know which view file is displaying the stock message, you can edit it via the Display&gt;Views menu.
The code modification you proposed in your message should be quite good to change the stock message. However, it won't affect the add to cart button. To change that, you would have to modify that line: Code:

$add_to_cart = !$catalogue_mode &amp;&amp; $in_stock &amp;&amp; (!$is_free &#124;&#124; $display_free_cart) &amp;&amp; $product_available;

For example, you could use: Code:

$add_to_cart = !$catalogue_mode &amp;&amp; $in_stock &amp;&amp; $this-&gt;row-&gt;product_quantity != -2 &amp;&amp; (!$is_free &#124;&#124; $display_free_cart) &amp;&amp; $product_available;

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

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

Less More

- Posts: 23
- Thank you received: 1
-
-

7 years 8 months ago [\#303703](#303703) by [Genusskanzlei](/forum/user/30057-genusskanzlei "View Genusskanzlei's Profile")  Replied by *[Genusskanzlei](/forum/user/30057-genusskanzlei "View Genusskanzlei's Profile")* on topic *[Products only available at the Store](/forum/26-product-category-display/896882-products-only-available-at-the-store#303703 "-- url of the page with the problem -- :   www.genusskanzlei.at/  -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.1 -- PHP version -- : 7.2.12 -- Browser(s) name and version -- : Chrome  Hi  I have once programmed a condition that when we set the quantity to &quot;-2&quot;, with the help of a new constant 'IN&#95;STORE,' the front-end will display &quot;Available at the Store&quot; (Erhältlich im Geschäft) instead of &quot;out of stock.&quot;  After changing the Theme, this is not working anymore, and I have tried and failed to get it working right following your code source.  For example, when I look at the following category:   www.genusskanzlei.at/index.php/genusskan...egory/115-aufstriche  all the products display the standard 'NO&#95;STOCK' --&gt; &quot;Out of Stock&quot; (&quot;Nicht vorrätig&quot;)  However, when I view the product page, I do get the 'IN&#95;STORE' message but also the &quot;add to cart&quot;; which in this case shouldn't be displayed since they can only be ordered directly.  I edited the 'com&#95;hikashop/product/quantity.php' and changed:  to  I want the 'IN&#95;STORE' message to display in the &quot;listing views&quot; and that the &quot;add to cart&quot; options, does not show for this condition. How can I edit the code to achieve these results?  I hope I have made myself understood and you could help me fix this problem, which is misleading the clients.  Thanks a lot in advance!")*

Hi,

thanks for the code suggestion, this part worked-

Now that I remember, I was not showing the shopping cart with the old Theme when I was viewing the category listing.

But the way I see it, this only affects the quantity check, therefore whatever that needs to be changed is in the quantity.php file (com_hikashop/product/quantity.php), which is the only one that calculates if a product is on stock or not.

Any ideas? Whatever I tried didn't change the listing view to 'ON_STORE'.

Thanks in advance!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTY4ODItcHJvZHVjdHMtb25seS1hdmFpbGFibGUtYXQtdGhlLXN0b3JlP3RtcGw9bWFya2Rvd24=) 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: 86363
- Thank you received: 14296
-
-

7 years 8 months ago [\#303711](#303711) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Products only available at the Store](/forum/26-product-category-display/896882-products-only-available-at-the-store#303711 "-- url of the page with the problem -- :   www.genusskanzlei.at/  -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.1 -- PHP version -- : 7.2.12 -- Browser(s) name and version -- : Chrome  Hi  I have once programmed a condition that when we set the quantity to &quot;-2&quot;, with the help of a new constant 'IN&#95;STORE,' the front-end will display &quot;Available at the Store&quot; (Erhältlich im Geschäft) instead of &quot;out of stock.&quot;  After changing the Theme, this is not working anymore, and I have tried and failed to get it working right following your code source.  For example, when I look at the following category:   www.genusskanzlei.at/index.php/genusskan...egory/115-aufstriche  all the products display the standard 'NO&#95;STOCK' --&gt; &quot;Out of Stock&quot; (&quot;Nicht vorrätig&quot;)  However, when I view the product page, I do get the 'IN&#95;STORE' message but also the &quot;add to cart&quot;; which in this case shouldn't be displayed since they can only be ordered directly.  I edited the 'com&#95;hikashop/product/quantity.php' and changed:  to  I want the 'IN&#95;STORE' message to display in the &quot;listing views&quot; and that the &quot;add to cart&quot; options, does not show for this condition. How can I edit the code to achieve these results?  I hope I have made myself understood and you could help me fix this problem, which is misleading the clients.  Thanks a lot in advance!")*

Hi,

Use the "display view files" setting and you'll see which view file is used on the listing instead of quantity, as I explained in my previous message.
It should normally be "add_to_cart_ajax.php"

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

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

Less More

- Posts: 23
- Thank you received: 1
-
-

7 years 8 months ago [\#303797](#303797) by [Genusskanzlei](/forum/user/30057-genusskanzlei "View Genusskanzlei's Profile")  Replied by *[Genusskanzlei](/forum/user/30057-genusskanzlei "View Genusskanzlei's Profile")* on topic *[Products only available at the Store](/forum/26-product-category-display/896882-products-only-available-at-the-store#303797 "-- url of the page with the problem -- :   www.genusskanzlei.at/  -- HikaShop version -- : 4.0.2 -- Joomla version -- : 3.9.1 -- PHP version -- : 7.2.12 -- Browser(s) name and version -- : Chrome  Hi  I have once programmed a condition that when we set the quantity to &quot;-2&quot;, with the help of a new constant 'IN&#95;STORE,' the front-end will display &quot;Available at the Store&quot; (Erhältlich im Geschäft) instead of &quot;out of stock.&quot;  After changing the Theme, this is not working anymore, and I have tried and failed to get it working right following your code source.  For example, when I look at the following category:   www.genusskanzlei.at/index.php/genusskan...egory/115-aufstriche  all the products display the standard 'NO&#95;STOCK' --&gt; &quot;Out of Stock&quot; (&quot;Nicht vorrätig&quot;)  However, when I view the product page, I do get the 'IN&#95;STORE' message but also the &quot;add to cart&quot;; which in this case shouldn't be displayed since they can only be ordered directly.  I edited the 'com&#95;hikashop/product/quantity.php' and changed:  to  I want the 'IN&#95;STORE' message to display in the &quot;listing views&quot; and that the &quot;add to cart&quot; options, does not show for this condition. How can I edit the code to achieve these results?  I hope I have made myself understood and you could help me fix this problem, which is misleading the clients.  Thanks a lot in advance!")*

Hi!

Sorry for the troubles:-(. I didn't find the "display view files" before. I edited the file and everything is working now.

Thanks!!

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

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