Jump to content

[PS 1.7] override Category.php


ps8modules.com

Recommended Posts

I created an override Category.php and modified sql in the getProducts function.
I added the condition 'AND p.id_product > 2'

Works only on homepage, does not display products with lower id than 2.

When I open a category page that contains products with an id less than 2 and it appears, it simply ignores the condition in sql.

Why is this happening?

Thank you

obrazek.png.91767962d1939cec7dc978469f5118e6.png

Page Home:

obrazek.thumb.png.d82bf4b688b651e4482c472569681ae6.png

obrazek.thumb.png.e0bc097e3ae01e4a2972b7aa965a5c83.png

 

=============================================================================================================================

=============================================================================================================================

Category page:

obrazek.thumb.png.950d97b6c50ad4930cbbfd3e38145085.png

obrazek.thumb.png.b06321aeb9b1cb25eacca1bd4a853317.png

 

 

I've already found a problem.
The problem is caused by the ps_facetedsearch module, which creates custom SQL categories for categories in ./modules/ps_facetedsearch/src/Adapter/MySQL.php
It will probably be a good solution to create an override for MySQL.php
How to create override of ps_facetedsearch and add custom where condition?

 Or use in a module actionProductListOverride and somehow use where?

Thank you

 

Edited by WebSoft (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...