ale123 Posted January 23 Share Posted January 23 (edited) Hi all. This is strange (to me). I'm trying to fetch all discounted products with: $products = Product::getPricesDrop( (int)Context::getContext()->language->id, 0, 100 ); But it's returning just 3 items regardless the more than 50 discounted products on the website. Trying to troubleshoot it i've seen that the query made by Product::getPricesDrop is returning (in $results) 50 products as expected. I can print_r($results) and see the 50 products, BUT, as soon as the flow run through $result = array_slice($result, (int) (($page_number - 1) * $nb_products), (int) $nb_products); only 3 products are returned in the array by the array_slice. (tested easily by placing a print_r above and below the suspected line) So, what else should I check ? The query is correct.... Edited January 23 by ale123 (see edit history) Link to comment Share on other sites More sharing options...
ale123 Posted January 23 Author Share Posted January 23 Ok i'm an idiot. I see just 3 products because the $nb_products is set to 3, i've thought it was 10...... Link to comment Share on other sites More sharing options...
Daresh Posted January 23 Share Posted January 23 What value is stored in $nb_products? 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