Sale menu item empty when there is nog discounted product

  • Posts: 20
  • Thank you received: 0
8 years 4 months ago #261014

-- HikaShop version -- : 2.6.4
-- Joomla version -- : latest
-- PHP version -- : 5.6.3
-- Browser(s) name and version -- : Firefox latest

Hi hikashop,

I have a menuitem with the product listing to "Discount only" and the category set on all products. This works fine when I have sale products, but when there are no sale items, all the products are displayd.
Is it possible to have it empty or a text that says something like "There are no sale items"

Thanx!
Regards,
Sanne

Please Log in or Create an account to join the conversation.

  • Posts: 83992
  • Thank you received: 13604
  • MODERATOR
8 years 4 months ago #261019

Hi,

Could you try changing the line:
if(!empty($discounts->max_product_id) || !empty($discounts->max_category_id) || !empty($discounts->max_category_children) || !empty($discounts->max_zone_id)) {
to:
if(true){
in the file components/com_hikashop/views/product/view.html.php ?
That line is there for efficiency but reviewing the code, this could lead is having the check on the discounts skipped in some rare case where you wouldn't have any active discount with either a category restriction or a product restriction or a zone restriction configured on your shop.

For the empty message, you'll have to customize the file "listing" of the view "product" in order to add your custom message when no products are found for that particular menu item.

The following user(s) said Thank You: sanneschoo

Please Log in or Create an account to join the conversation.

  • Posts: 20
  • Thank you received: 0
8 years 4 months ago #262370

Sorry for the late replay. This worked!
Thanks for the code :-)

Please Log in or Create an account to join the conversation.

Time to create page: 0.060 seconds
Powered by Kunena Forum