Jump to content

Hiding manufacturer from prices-drop page


Recommended Posts

I would like to hide products from a specific manufacturer from the prices-drop page. I found the getPricesDrop function in classes/Product.php. I replaced this part of the query:

' . ((!$beginning && !$ending) ? ' AND p.`id_product` IN (' . ((is_array($tab_id_product) && count($tab_id_product)) ? implode(', ', $tab_id_product) : 0) . ')' : '') . '
' . $sql_groups;

to this:

' . ((!$beginning && !$ending) ? ' AND p.`id_product` IN (' . ((is_array($tab_id_product) && count($tab_id_product)) ? implode(', ', $tab_id_product) : 0) . ')' : '') . '
AND p.`id_manufacturer` != 32
' . $sql_groups;

Still, the products are showing up. Could someone point out what I'm doing wrong? Thanks!

Link to comment
Share on other sites

  • 2 weeks later...
Posted (edited)

Hello @VillanyLeo,

To hide a specific manufacturer from the price-drop page, follow these steps:

Step 1: Locate the manufacturer's ID in the PrestaShop back office.
Step 2: In the getPricesDrop function within the classes/Product.php file, create a variable named $excludeManufacturerID and assign it a value like ('1','2'), replacing these IDs with the ones you want to exclude.
Step 3: Now, add the following line of code to the same function, as shown in the screenshot: https://app.screencast.com/jMpThUeyasI42

AND p.`id_manufacturer` NOT IN '.$excludeManufacturerID.'

 

Edited by WebDesk Solution (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...