Jump to content

[Solved] How to make a products quantity limitation in the module"in the same category"


Guest Steven_king

Recommended Posts

Hi,

I would like to show 8 products in "in the same category", is this possible?

there are hundreds of products in one category, if there is no quantity limit "in the same category", the product.php won't load

Link to comment
Share on other sites

There is a quantity limit of 30 in the module. You can change it on line 51 of modules/productscategory/productscategory.php:

$sizeOfCategoryProducts = $category->getProducts(intval($cookie->id_lang), 1, 30, NULL, NULL, true);



Try change 30 to 8.

Link to comment
Share on other sites

Thanks. I just tested the code on my test site and you are right that it doesn't work. Try changing lines 51-52 to the following instead:

$sizeOfCategoryProducts = $category->getProducts(intval($cookie->id_lang), 1, 30, NULL, NULL, true);
if ($sizeOfCategoryProducts > 8)
   $sizeOfCategoryProducts = 8;
$categoryProducts = $category->getProducts(intval($cookie->id_lang), 1, $sizeOfCategoryProducts);



This should display no more than 8 products in the same category.

Link to comment
Share on other sites

It works great. I look for the solution for quite a long time.Thank you very much Rocky.

Can you help me with another 2 issues?

One of them is here

Link to comment
Share on other sites

×
×
  • Create New...