Neil Trinh Posted June 22, 2016 Share Posted June 22, 2016 (edited) Hi, I'm trying to get all of the products by manufacture in Prestashop 1.6.1.6. In classes/Manufacturer.php, I found: public static function getProducts($id_manufacturer, $id_lang, $p, $n, $order_by = null, $order_way = null, $get_total = false, $active = true, $active_category = true, Context $context = null) And my module: $products = Manufacturer::getProducts(1,$default_lang, 1, 0, 'id_product'); var_dump($products); But the result's bool(false) I can get all of the products then compare if product.id_manufacturer == my id_manufacturer but I have 8000 products. So I think get products by manufacturer is the best way. Many thanks in advanced! Edited June 22, 2016 by Neil Trinh (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted June 22, 2016 Share Posted June 22, 2016 It's hard to help without seeing the exact error message. I noticed you have set $n to 0, which means you're asking for 0 products per page. That's probably going to cause an error. It's also possible that $default_lang is empty or has an invalid value. I suggest that you turn on development mode so you can see the MySQL error. To do this, edit config/defines.inc.php and change _PS_DEV_MODE_ from false to true. You should then see an error page with the MySQL query and where the error is. 1 Link to comment Share on other sites More sharing options...
Neil Trinh Posted June 22, 2016 Author Share Posted June 22, 2016 Hi rocky, The problem has been clarified. $n to 0, which means you're asking for 0 products per page. Many thanks for your help. 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