emisrw Posted April 24, 2018 Share Posted April 24, 2018 Hi, I want get new products from category. So i tried change controller. In prestashop 1.7 is NewProductsController.php, And inside is function protected function getProductSearchQuery() { $query = new ProductSearchQuery(); $query ->setQueryType('new-products') ->setSortOrder(new SortOrder('product', 'date_add', 'desc')) ; return $query; } And i change protected function getProductSearchQuery() { $query = new ProductSearchQuery(); $query ->setIdCategory('MY-NEW-ID-CATEGORY') ->setQueryType('new-products') ->setSortOrder(new SortOrder('product', 'date_add', 'desc')) ; return $query; } But still showing all products, not products from category. Link to comment Share on other sites More sharing options...
tdsoft Posted April 24, 2018 Share Posted April 24, 2018 Please upload your PHP file at here Link to comment Share on other sites More sharing options...
emisrw Posted April 25, 2018 Author Share Posted April 25, 2018 (edited) Here is discussion https://stackoverflow.com/questions/50000335/new-products-from-specific-category-prestashop Working but i still having problem. Is only one product in my category, but showing all products. When I click on pagination all products are shown Edited April 25, 2018 by emisrw (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now