Jump to content

Missing discounted products


Recommended Posts

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 by ale123 (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...