Jump to content


Photo

change order of products in featured products on homepage


  • Please log in to reply
1 reply to this topic

#1 OVOnel

OVOnel

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 12 December 2017 - 12:36 AM

Hi. Some times ago i installed module "Featured category products on the homepage v1.7.2". Can you help me to change the order of displayed products? I want to show products in decrescent id order.



looking for the best presta addons with outstanding support? check this: PrestaShop Modules

#2 vekia

vekia

    Advanced Member

  • Members
  • PipPipPip
  • 10166 posts

Posted 12 December 2017 - 12:36 AM

Hello Sergio,

welcome after weekend,

What is your current prestashop version?

 

if prestashop 1.6.1.x, below instructions:

open main module file: featuredcategory.php

near line 109 you can find code:

featuredcategory::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position');

change it to:

featuredcategory::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'id_product', 'DESC');

and save the file. After this it might be required to clean shop cache (otherwise changes will be visible with delay).

 

best regards,

milos


free tutorials, free templates, free addons, prestashop modules MndfRK4.png  lpHMrZ5.png  gtKHYO7.png  google-48.png