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....
.png.022b5452a8f28f552bc9430097a16da2.png)