- Posts: 31
- Thank you received: 0
Empty page for empty categories
when i click the categories of my shop that are empty, i see an empty page.
[img size=Here] www.fiorionlinevotadoro.it/new/ [/img]
Is there anyway to have a message that tells to the customers "there are no products in this categories"?
Thanks
Please Log in or Create an account to join the conversation.
You will have to edit the file "listing" of the view "product" via the menu Display->Views and change the code:
<?php }
$html = ob_get_clean();
to:
<?php }else{
echo 'there are no products in this categories';
}
$html = ob_get_clean();
Please Log in or Create an account to join the conversation.
Thank you!
Please Log in or Create an account to join the conversation.
Did it but i see no effect. I also so no effect when altering tables in order to get show the product info below the image (read that in another post).
It is as if I am changing the wrong file that has nothing to do with this.
I even see the trashcan next to "listing" to remove the customization, and it's there when I exit and come back, but still nothing on the blank pages.
Any ideas?
p.s.
I cleared cache.
p.s.
I just got fed up with it and deleted everything from listing.php (yes, it's empty) and saved it, and it all still works like i didn't delete anything :laugh: Should I maybe make the change in the actual php file, rather than in the display > view section?
Please Log in or Create an account to join the conversation.
When you are in the menu Display->Views, you will have one occurrence of each hikashop view file for each one of your templates. So if you don't see the changes you're making in a view file, it means that you're probably editing the view file for another template than the one you're actually using on your front end.
Or that you have page caching on your website.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The text message is working fine as Nicolas has described it.
I have used a text variable LS_EMPTY_LIST, because I have a multi language page:
<?php }else{
echo "<font color='#FF00EB'>";
echo JText::_('LS_EMPTY_LIST');
echo "</font>";
}
$html = ob_get_clean();
Is there a chance to show a MODULE , ideal with a BACK button in that module, if the category is empty?
I did not find a way with the ADVANCED MODULE MANAGER.
Thank you
Lutz
Please Log in or Create an account to join the conversation.
You can use such extension to add a module display wherever you want with a simple tag:
extensions.joomla.org/extensions/core-en...embed-a-include/6402
Please Log in or Create an account to join the conversation.
its working great.
Lutz
Please Log in or Create an account to join the conversation.
I tried to find the exact code on that file, but only found
}
}
$html = ob_get_clean();
It seems the code has changed. I tried to put the code before
$html = ob_get_clean();
but it didn't work. Where to put the code for empty categories here?
Thanks,
Andreas
Please Log in or Create an account to join the conversation.
Now, you can replace the code:
Please Log in or Create an account to join the conversation.
in the view product/listing I can not find the exact code but very similar:
If I replace it with the code you wrote there is still nothing displayed on empty categories.
Is the code in another view now?
Please Log in or Create an account to join the conversation.
The given code should work fine, are you sure that you are editing the view in the correct template ?
Please Log in or Create an account to join the conversation.
I double checked and I did everything as described. There is only a small difference in the code I found in my listing view (as I posted before).
Please Log in or Create an account to join the conversation.
Are you sure that you edited the right view (I mean, for the right front-end template) ?
You can add some html content in the view in order to be sure that your modification is right displayed in the front-end.
If you're sure that you edited the right view for the right template, please provide a link to your website.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
yes I am sure and I placed some html code to verify it.
Before editing anything the code looks like the 1st attached file (I am using JM Creatrix template from joomlaman.com).
[strike]Link is attached in 2nd file.[/strike] link attached to the issue ticket
Regards
Please Log in or Create an account to join the conversation.
did you have the chance to check the code?
Regards
Please Log in or Create an account to join the conversation.
I just looked at the file www.hikashop.com/media/kunena/attachments/33433/listing.txt that you provided but I don't see the code change that I gave you added in.
Also, you provided a link to your website, but you didn't provide a direct link to the page where you want that to display so I checked your website but couldn't find it.
Please Log in or Create an account to join the conversation.
the problem was that I filtered product & my template in views. But I didn't realize that still category/listing.php and product/listing.php were in the list. So when I tried it out, I used category/listing.php and that was the problem.
Now it works.
Thank you very much!
Please Log in or Create an account to join the conversation.
I used the above code to add a note to empty categories which worked great but I have now spotted that the same note shows at the bottom of every product as well now. Any idea why this is happening? I only want it to show on empty catagories.
Please Log in or Create an account to join the conversation.