Jump to content

MathB

New Members
  • Posts

    2
  • Joined

  • Last visited

MathB's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Thank you MusicMaster for your help! 👌 As I suspected I couldn't find any query with 'p.`on_sale` = 1 ' in it... In fact, I couldn't find any part of the whole query even though my override file is in the list of files included... I guess the simple way to do what I want is not the right way 😅
  2. Hi everyone! Unless I have missed it, I don't think that my problem has been raised in previous post, so I hope someone will be able to help me or direct me to the right place. 😊 I am currently setting up a shop with Prestashop version 8 where I want to show in the Special block and Prices Drop page only products with the 'on_sale' flag. To do so, I've been following this topic that is quite simple: create an override of Product.php and in the functions getRandomSpecial() and getPricesDrop() add to SQL WHERE conditions 'p.`on_sale`= 1 AND '. I tried to put this at the beginning of the WHERE condition, with and without brackets surrounding the rest of the condition, I tried to put it at the end of the condition and I also did so directly in the main Product.php disabling the override one. Before every attempt I cleared the cache through the BO or by erasing directories in /var/cache/. Whichever way I tried, the Prices Drop page still has every products with a specific price, even those that are not labeled as 'on_sale'... It is as if other getRandomSpecial() and getPricesDrop() functions exist somewhere else and has the priority over my modified queries... Can someone help me understand what is happening? NB: In the case of Prices Drop page, I went down the rabbit hole of looking into controllers/front/listing/PricesDropController.php then Adapter\PricesDrop\PricesDropProductSearchProvider.php to see where getPricesDrop() is called and it is definitely called through Product class.
×
×
  • Create New...