Jump to content

How to modify SQL of product listing for selected category on front end side


Dhara1510
 Share

Recommended Posts

I need to modify the listing of the products for the selected category. For that i need to modify the sql query of the listing.

I really tried hard to search for the sql but i cannot found that. From other forums i found that

 `classes/Category.php`

file have `getProducts` method which will work. I tried to modify it but it only modify the listing for the Home page only.

I want to modify when user go to `All Product` and selected any category. I tried but i failed. Can anyone please help me. 

Edited by Dhara1510 (see edit history)

Share this post


Link to post
Share on other sites

  • 2 weeks later...

It really depends what do you want to change in this listing.

In presta 1.7 the controller which is responsible for getting products (basically it's done via ProductSearchQuery class which manages it) is /controllers/front/listing/CategoryController.php, and "getProductSearchQuery()" method.

Share this post


Link to post
Share on other sites

  • 9 months later...

When a custom order is done, a new product appear into the product list from the back office, the reference of this product is "custom-" and a series of random number. i do not want to delete this generated custom product. but i need them to not appear in the back office product list. i've made query in phpMyAdmin like " SELECT reference FROM ps_product WHERE reference NOT LIKE 'custom-%' " it works fine and return every product from the ps_product table, and does not select the customs. but in pretashop source code, querys are quite different, and i can't find out how i can make it.

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More