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

#   How To Display A Message When Category Is Empty

##

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

Less More

- Posts: 256
- Thank you received: 2
-
-

11 years 11 months ago [\#183677](#183677) by [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")  *[How To Display A Message When Category Is Empty](/forum/26-product-category-display/873719-how-to-display-a-message-when-category-is-empty#183677 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Is it possible to automatically show a message when there aren't any products in a category? Something like &quot;We're sorry, there aren't any products here at the moment, please check back later&quot;.  I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.  Any help would be greatly appreciated, Thanks.")* was created by *[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")*

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6

Is it possible to automatically show a message when there aren't any products in a category? Something like "We're sorry, there aren't any products here at the moment, please check back later".

I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.

Any help would be greatly appreciated,
Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM3MTktaG93LXRvLWRpc3BsYXktYS1tZXNzYWdlLXdoZW4tY2F0ZWdvcnktaXMtZW1wdHk/dG1wbD1tYXJrZG93bg==) 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 11 months ago -  11 years 11 months ago [\#183686](#183686) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[How To Display A Message When Category Is Empty](/forum/26-product-category-display/873719-how-to-display-a-message-when-category-is-empty#183686 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Is it possible to automatically show a message when there aren't any products in a category? Something like &quot;We're sorry, there aren't any products here at the moment, please check back later&quot;.  I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.  Any help would be greatly appreciated, Thanks.")*

Hi,

You can potentially edit the view "product / listing_div" and at the end add: Code:

&lt;?php else{echo "We're sorry, there aren't any products here at the moment, please check back later";} ?&gt;

Last edit: 11 years 11 months ago by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile").

The following user(s) said Thank You: [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")

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

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

Less More

- Posts: 256
- Thank you received: 2
-
-

11 years 11 months ago [\#183927](#183927) by [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")  Replied by *[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")* on topic *[How To Display A Message When Category Is Empty](/forum/26-product-category-display/873719-how-to-display-a-message-when-category-is-empty#183927 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Is it possible to automatically show a message when there aren't any products in a category? Something like &quot;We're sorry, there aren't any products here at the moment, please check back later&quot;.  I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.  Any help would be greatly appreciated, Thanks.")*

Hi Xavier,

Thanks for your reply. I've just tried this but when I add the code at the bottom of the file it make the pages lose all formatting and they seem to lose all CSS styling too (see attached screenshots of before and after).

Do you have any other ideas?

Thank you.

- [ ![Before.png](/forum/attachment/21302) ](/forum/attachment/21302 "Before.png") [ ](/forum/attachment/21302?download=1 "Before.png")
- [ ![After.png](/forum/attachment/21303) ](/forum/attachment/21303 "After.png") [ ](/forum/attachment/21303?download=1 "After.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM3MTktaG93LXRvLWRpc3BsYXktYS1tZXNzYWdlLXdoZW4tY2F0ZWdvcnktaXMtZW1wdHk/dG1wbD1tYXJrZG93bg==) 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: 86587
- Thank you received: 14325
-
-

11 years 11 months ago [\#183939](#183939) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How To Display A Message When Category Is Empty](/forum/26-product-category-display/873719-how-to-display-a-message-when-category-is-empty#183939 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Is it possible to automatically show a message when there aren't any products in a category? Something like &quot;We're sorry, there aren't any products here at the moment, please check back later&quot;.  I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.  Any help would be greatly appreciated, Thanks.")*

Hi,

This indicates an error in the code.
Please do a screenshot of the modification you made in the listing_div view file so that we can see what you did.

The following user(s) said Thank You: [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")

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

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

Less More

- Posts: 256
- Thank you received: 2
-
-

11 years 11 months ago [\#184098](#184098) by [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")  Replied by *[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")* on topic *[How To Display A Message When Category Is Empty](/forum/26-product-category-display/873719-how-to-display-a-message-when-category-is-empty#184098 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Is it possible to automatically show a message when there aren't any products in a category? Something like &quot;We're sorry, there aren't any products here at the moment, please check back later&quot;.  I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.  Any help would be greatly appreciated, Thanks.")*

Here is the screenshot of how I implemented the code. I put the code at the end of the file as suggested earlier.

- [ ![Screen&#95;Shot&#95;2014-12-22&#95;at&#95;09&#95;18&#95;12.png](/forum/attachment/21331) ](/forum/attachment/21331 "...t&#95;09&#95;18&#95;12.png") [ ](/forum/attachment/21331?download=1 "...t&#95;09&#95;18&#95;12.png")

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

11 years 11 months ago [\#184113](#184113) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[How To Display A Message When Category Is Empty](/forum/26-product-category-display/873719-how-to-display-a-message-when-category-is-empty#184113 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Is it possible to automatically show a message when there aren't any products in a category? Something like &quot;We're sorry, there aren't any products here at the moment, please check back later&quot;.  I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.  Any help would be greatly appreciated, Thanks.")*

Can you replace that line : Code:

&lt;?php else{echo "We're sorry, there aren't any products here at the moment, please check back later"} ?&gt;

By : Code:

&lt;?php else{echo "We're sorry, there aren't any products here at the moment, please check back later";} ?&gt;

The following user(s) said Thank You: [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")

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

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

Less More

- Posts: 256
- Thank you received: 2
-
-

11 years 11 months ago [\#184220](#184220) by [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")  Replied by *[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")* on topic *[How To Display A Message When Category Is Empty](/forum/26-product-category-display/873719-how-to-display-a-message-when-category-is-empty#184220 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Is it possible to automatically show a message when there aren't any products in a category? Something like &quot;We're sorry, there aren't any products here at the moment, please check back later&quot;.  I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.  Any help would be greatly appreciated, Thanks.")*

Hi, thanks for your reply.

Unfortunately this code brings the same error as before. Is it possible i've put the code in the wrong place? It is right at the end of the listing_div file as seen in my earlier post.

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM3MTktaG93LXRvLWRpc3BsYXktYS1tZXNzYWdlLXdoZW4tY2F0ZWdvcnktaXMtZW1wdHk/dG1wbD1tYXJrZG93bg==) 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: 86587
- Thank you received: 14325
-
-

11 years 11 months ago [\#184228](#184228) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How To Display A Message When Category Is Empty](/forum/26-product-category-display/873719-how-to-display-a-message-when-category-is-empty#184228 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Is it possible to automatically show a message when there aren't any products in a category? Something like &quot;We're sorry, there aren't any products here at the moment, please check back later&quot;.  I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.  Any help would be greatly appreciated, Thanks.")*

Try to remove the code:
?&gt;

&lt;?php

before the echo after doing your modification.
Maybe PHP doesn't like having the else statement cut from the if statement like that

The following user(s) said Thank You: [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")

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

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

Less More

- Posts: 256
- Thank you received: 2
-
-

11 years 10 months ago [\#185543](#185543) by [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")  Replied by *[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")* on topic *[How To Display A Message When Category Is Empty](/forum/26-product-category-display/873719-how-to-display-a-message-when-category-is-empty#185543 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Is it possible to automatically show a message when there aren't any products in a category? Something like &quot;We're sorry, there aren't any products here at the moment, please check back later&quot;.  I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.  Any help would be greatly appreciated, Thanks.")*

Thank you for your reply, I have the message appearing now, although it is also appearing on the 'categories listing' pages too (see link: [ www.treasurefindersuk.com/our-products/jewellery-and-gold](http://www.treasurefindersuk.com/our-products/jewellery-and-gold)) where as we only need it to show on 'product listing' pages.

Is there anything I can do to stop it showing on the 'categories listing' pages?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL3Byb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM3MTktaG93LXRvLWRpc3BsYXktYS1tZXNzYWdlLXdoZW4tY2F0ZWdvcnktaXMtZW1wdHk/dG1wbD1tYXJrZG93bg==) 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 10 months ago [\#185579](#185579) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[How To Display A Message When Category Is Empty](/forum/26-product-category-display/873719-how-to-display-a-message-when-category-is-empty#185579 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Is it possible to automatically show a message when there aren't any products in a category? Something like &quot;We're sorry, there aren't any products here at the moment, please check back later&quot;.  I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.  Any help would be greatly appreciated, Thanks.")*

Hi,

You can potentially use that code instead: Code:

elseif(!in_array(hikashop_getCID('category'),array('2'))){ echo "We're sorry, there aren't any products here at the moment, please check back later"; }

And in the array, you can add more values for the parent categories, for example add the id of the parent categories of the categories "Gold Jewellery, Silver Jewellery, Gold Collectables", etc.

The following user(s) said Thank You: [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")

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

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

Less More

- Posts: 256
- Thank you received: 2
-
-

11 years 10 months ago [\#186308](#186308) by [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")  Replied by *[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")* on topic *[How To Display A Message When Category Is Empty](/forum/26-product-category-display/873719-how-to-display-a-message-when-category-is-empty#186308 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Is it possible to automatically show a message when there aren't any products in a category? Something like &quot;We're sorry, there aren't any products here at the moment, please check back later&quot;.  I've tried a few solutions from other (older) posts but none of them worked with this version of HikaShop.  Any help would be greatly appreciated, Thanks.")*

Thank you very much, this is working perfectly!

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

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