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

#   Add Message In Empty Category

##

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

Less More

- Posts: 966
- Thank you received: 11
-
-

13 years 10 months ago [\#82130](#82130) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  *[Add Message In Empty Category](/forum/4-how-to/76761-add-message-in-empty-category#82130 "Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a...")* was created by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")*

Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a message something like "Sorry no products at this time".

Thanks!!

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 10 months ago [\#82315](#82315) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Add Message In Empty Category](/forum/4-how-to/76761-add-message-in-empty-category#82315 "Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a...")*

Yes it's possible, you have to edit the view "category / listing" in HikaShop &gt; Display &gt; views and if there is no elements in the var "$this-&gt;fields" then display the message.

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

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

Less More

- Posts: 966
- Thank you received: 11
-
-

13 years 9 months ago [\#86823](#86823) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Add Message In Empty Category](/forum/4-how-to/76761-add-message-in-empty-category#86823 "Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a...")*

Sorry but I'm looking at the code but not sure what to do :huh:

I see the below what should I do here?

> if(!empty($this-&gt;fields)){ ?&gt;

Thanks!!

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 9 months ago [\#86879](#86879) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Add Message In Empty Category](/forum/4-how-to/76761-add-message-in-empty-category#86879 "Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a...")*

Try to use this code: Code:

if(empty($this-&gt;fields)) echo JText::_('NO_PRODUCTS_AT_THIS_TIME');

And add the translation: NO_PRODUCTS_AT_THIS_TIME="Sorry no products at this time"
in the translation override file:
[ www.hikashop.com/fr/support/documentation/faq.html#translation](http://www.hikashop.com/fr/support/documentation/faq.html#translation)

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

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

Less More

- Posts: 966
- Thank you received: 11
-
-

13 years 7 months ago [\#92712](#92712) by [MyWorld](/forum/user/862-myworld "View MyWorld's Profile")  Replied by *[MyWorld](/forum/user/862-myworld "View MyWorld's Profile")* on topic *[Add Message In Empty Category](/forum/4-how-to/76761-add-message-in-empty-category#92712 "Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a...")*

Hi Xavier,

I add the code you provided as per below and it works but it's also add the line "Additional Information" not sure why that is?
Code:

&lt;?php } if(empty($this-&gt;fields)) echo JText::_('NO_PRODUCTS_AT_THIS_TIME');{ ?&gt;

Sorry no products at this time
Additional information

Thanks!!

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 7 months ago [\#92826](#92826) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Add Message In Empty Category](/forum/4-how-to/76761-add-message-in-empty-category#92826 "Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a...")*

First of all, you have to remove the "{" at the end of your code, it will return an error.
Or use: Code:

if(empty($this-&gt;fields)){ echo JText::_('NO_PRODUCTS_AT_THIS_TIME'); }

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

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

Less More

- Posts: 41
- Thank you received: 0
-
-

11 years 6 months ago [\#196744](#196744) by [MiloW](/forum/user/35910-milow "View MiloW's Profile")  Replied by *[MiloW](/forum/user/35910-milow "View MiloW's Profile")* on topic *[Add Message In Empty Category](/forum/4-how-to/76761-add-message-in-empty-category#196744 "Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a...")*

Hello,

I changed line 70 or something
if(empty($this-&gt;fields)) echo JText::_('NO_PRODUCTS_AT_THIS_TIME');

and added translation but now it shows on every page, not only on category page without products. Where's my error?

I edited category &gt; listing.

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 6 months ago [\#196748](#196748) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Add Message In Empty Category](/forum/4-how-to/76761-add-message-in-empty-category#196748 "Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a...")*

Hi,

The error is that this modification allow to display a message if there is no subcategories, not if there is no products in the category.

So in your case the edition of the view "product / listing" seems to be more appropriate.
You should find existing topics about that in the forum ![:)](/media/kunena/emoticons/8.png ":)")

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

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

Less More

- Posts: 41
- Thank you received: 0
-
-

11 years 6 months ago [\#196835](#196835) by [MiloW](/forum/user/35910-milow "View MiloW's Profile")  Replied by *[MiloW](/forum/user/35910-milow "View MiloW's Profile")* on topic *[Add Message In Empty Category](/forum/4-how-to/76761-add-message-in-empty-category#196835 "Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a...")*

Couldn't find any. Too many with vague topics.

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 6 months ago [\#196896](#196896) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Add Message In Empty Category](/forum/4-how-to/76761-add-message-in-empty-category#196896 "Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a...")*

Hi,

Please add the following code at the end of the view: Code:

if(($this-&gt;module &#124;&#124; (!$this-&gt;module &amp;&amp; empty($this-&gt;modules))) &amp;&amp; empty($this-&gt;rows)) echo 'here';

The following user(s) said Thank You: [MiloW](/forum/user/35910-milow "View MiloW's Profile")

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

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

Less More

- Posts: 41
- Thank you received: 0
-
-

11 years 6 months ago [\#196918](#196918) by [MiloW](/forum/user/35910-milow "View MiloW's Profile")  Replied by *[MiloW](/forum/user/35910-milow "View MiloW's Profile")* on topic *[Add Message In Empty Category](/forum/4-how-to/76761-add-message-in-empty-category#196918 "Is it possible to add a message when there are no products in a category? I know I can hide the category if there are no products but the client does not want to hide it instead would prefer a...")*

Great, thank you!

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

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

[](#top)
