Version 3.0.4.0
Is there a way to remove the text "There are no products to list in this category"?
I have a category that is all custom made and so there are no actual products to show, but I have a slide show on that page showing some different past products.
Is there a way to remove the text "There are no products to list in this category"?
I have a category that is all custom made and so there are no actual products to show, but I have a slide show on that page showing some different past products.
Last edited by mazman on Sat Dec 14, 2024 5:47 am, edited 1 time in total.
In the template file ( catalog/view/theme/default/template/product/category.twig ) it is this
In the language file (catalog/language/en-gb/product/category.php ) it is this
Code: Select all
{% if not categories and not products %}
<p>{{ text_empty }}</p>
<div class="buttons">
<div class="pull-right"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
</div>
{% endif %}
Code: Select all
$_['text_empty'] = 'There are no products to list in this category.';
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Can we consider this [SOLVED]?
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Legendary Member
Hmmm. First I blanked out the text in the category.php file listed and it had no effect at all. So second, I went to the category.twig file and commented out the code mentioned above and still no difference. Other changes that I've made to the page show up but that line remains.by mona wrote: ↑Thu Dec 12, 2024 4:56 pmIn the template file ( catalog/view/theme/default/template/product/category.twig ) it is thisIn the language file (catalog/language/en-gb/product/category.php ) it is thisCode: Select all
{% if not categories and not products %} <p>{{ text_empty }}</p> <div class="buttons"> <div class="pull-right"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div> </div> {% endif %}
Code: Select all
$_['text_empty'] = 'There are no products to list in this category.';
I've cleared the cache in my browser, switched to a different browser, even checked on a phone that has never been to the site and it is still there.
It's not the end of the world, but its just a little aggrivation.
The same thing annoyed me like crazy. I suggest you get an extension that hides the category itself if it is empty...my opinion...it's just as bad seeing an empty category as seeing that message...to me as a shopper screams poor upkeep with the shop.
If you've made edits cleared cache and not seeing a change sounds like you're editing the original file instead of the ocmod version in your storage directory.
If you've made edits cleared cache and not seeing a change sounds like you're editing the original file instead of the ocmod version in your storage directory.
v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
Definitely the right code. The issue is elsewhere.mazman wrote: ↑Fri Dec 13, 2024 9:33 pmHmmm. First I blanked out the text in the category.php file listed and it had no effect at all. So second, I went to the category.twig file and commented out the code mentioned above and still no difference. Other changes that I've made to the page show up but that line remains.
I've cleared the cache in my browser, switched to a different browser, even checked on a phone that has never been to the site and it is still there.
It's not the end of the world, but its just a little aggrivation.
1. A theme? this would change the /default/ part of the file path.
2. Using theme editor and OCMOD (and vqmod) ? - if you dont know exactly what everything does, it is best not to use them together as they can conflict.
3. Installed Lightning speed? - Need to refresh it for things to take effect.
4. Server caching? Your server may cache your site also.
5. Did not refresh modifications to take effect?
6. Made changes to the modification file and did refresh modifications.
There are many possibilities of where it is could be going wrong depending on your particular set up.
The code is right, so start there. You only need to do one (which you know) - I would prefer to comment out the twig myself, but either will work.
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Going through options 1-6 above, the only question mark is #4. All others I've done or do not apply. Is there actually an extenstion that does this?by mona wrote: ↑Sat Dec 14, 2024 12:35 amDefinitely the right code. The issue is elsewhere.mazman wrote: ↑Fri Dec 13, 2024 9:33 pmHmmm. First I blanked out the text in the category.php file listed and it had no effect at all. So second, I went to the category.twig file and commented out the code mentioned above and still no difference. Other changes that I've made to the page show up but that line remains.
I've cleared the cache in my browser, switched to a different browser, even checked on a phone that has never been to the site and it is still there.
It's not the end of the world, but its just a little aggrivation.
1. A theme? this would change the /default/ part of the file path.
2. Using theme editor and OCMOD (and vqmod) ? - if you dont know exactly what everything does, it is best not to use them together as they can conflict.
3. Installed Lightning speed? - Need to refresh it for things to take effect.
4. Server caching? Your server may cache your site also.
5. Did not refresh modifications to take effect?
6. Made changes to the modification file and did refresh modifications.
There are many possibilities of where it is could be going wrong depending on your particular set up.
The code is right, so start there. You only need to do one (which you know) - I would prefer to comment out the twig myself, but either will work.
Who is online
Users browsing this forum: Bing [Bot] and 25 guests