gopresta.pl Posted December 3, 2018 Share Posted December 3, 2018 (edited) Chciałbym zmodyfikować moduł "productscategory" PS1.6 który pobiera "podobne" produkty czyli produkty z tej samej kategorii. Ja chciałbym aby pobierał produkty z tej samej kategorii i tego samego producenta. Wtedy przynajmniej w moim sklepie były by to rzeczywiście podobne produkty. Domyślam się, że trzeba by zmodyfikować tą linię: $category_products = $category->getProducts($this->context->language->id, 1, 100); /* 100 products max. */ Ktoś pomoże? Edited December 3, 2018 by Meblolux (see edit history) Link to comment Share on other sites More sharing options...
Daresh Posted December 3, 2018 Share Posted December 3, 2018 Przed tą pętlą: foreach ($category_products as $key => $category_product) { if ($category_product['id_product'] == $id_product) { unset($category_products[$key]); break; } } Dodałbym jeszcze jedną: foreach ($category_products as $key => $category_product) { if ($category_product['id_manufacturer'] != $product->id_manufacturer) { unset($category_products[$key]); } } 1 Link to comment Share on other sites More sharing options...
gopresta.pl Posted December 3, 2018 Author Share Posted December 3, 2018 Działa :)) 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