Jump to content

productscategory module - product limit fix? (PS 1.6)


NoroHadzi

Recommended Posts

Hello,

Im using original module productscategory on prestashop 1.6. I want to show 6 products, so i changed this line:

$category_products = $category->getProducts($this->context->language->id, 1, 6); /* 100 products max. */

Problem is, in some products I see only 5 products. 

I think the problem is becouse of deleting current product from the list... (when I delete this lines of code, i see in each product the right number - 6 products, but one is the same as current product):

// Remove current product from the list
            if (is_array($category_products) && count($category_products))
            {
                foreach ($category_products as $key => $category_product)
                {
                    if ($category_product['id_product'] == $id_product)
                    {
                        unset($category_products[$key]);
                        break;
                    }
                }

Does anybody have modification that works for selected number of products and not showing current product in list? Thanks

Edited by NoroHadzi (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...