detoloslaos Posted August 26, 2018 Share Posted August 26, 2018 Hi!! I am trying to get all the product information but when I use the method getProducts I get an empty array.. This is my code.. <?php include('config/config.inc.php'); include('init.php'); $productObj = new Product(); $products = $productObj -> getProducts($id_lang, 0, 10, 'id_product', 'DESC' ); echo 'before de foreach'; foreach($products as $product) { echo 'inside foreach'; } ?> So.. I have aprox more than 30k products.. what I am doing wrong. Thanks in advance. Link to comment Share on other sites More sharing options...
Guest Posted August 26, 2018 Share Posted August 26, 2018 Maybe grab the product array from the cart instance instead? Link to comment Share on other sites More sharing options...
detoloslaos Posted August 26, 2018 Author Share Posted August 26, 2018 13 minutes ago, PrestaRalph said: Maybe grab the product array from the cart instance instead? Sorry.. i do not understand your solution Link to comment Share on other sites More sharing options...
Knowband Plugins Posted August 27, 2018 Share Posted August 27, 2018 15 hours ago, detoloslaos said: Hi!! I am trying to get all the product information but when I use the method getProducts I get an empty array.. This is my code.. <?php include('config/config.inc.php'); include('init.php'); $productObj = new Product(); $products = $productObj -> getProducts($id_lang, 0, 10, 'id_product', 'DESC' ); echo 'before de foreach'; foreach($products as $product) { echo 'inside foreach'; } ?> So.. I have aprox more than 30k products.. what I am doing wrong. Thanks in advance. As per my understanding, your code is absolutely correct. Kindly ensure that you are passing correct id_lang. Try to pass hardcode value like 1 for id_lang & check again. 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