Jump to content

Top Sellers aka Best Sellers Block


vegaskev

Recommended Posts

How do I limit the amount of products displayed in the Top Sellers List (Best Sellers Block)?

 

I notice there are no settings inside the module > configure screen.  I'm still a little green on MVC & PrestaShop or I'd start hacking away at the blockbestsellers.php file.  Any guidance would be greatly appreciated.

 

Thanks in advance.

Link to comment
Share on other sites

blockbestsellers.php

there is a function
 

	protected function getBestSellers($params)
	{
		if (Configuration::get('PS_CATALOG_MODE'))
			return false;

		if (!($result = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, 8)))
			return (Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY') ? array() : false);

		$currency = new Currency($params['cookie']->id_currency);
		$usetax = (Product::getTaxCalculationMethod((int)$this->context->customer->id) != PS_TAX_EXC);
		foreach ($result as &$row)
			$row['price'] = Tools::displayPrice(Product::getPriceStatic((int)$row['id_product'], $usetax), $currency);

		return $result;
	}

change 8 in:
 

if (!($result = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, 8)))

to any other value you want

Link to comment
Share on other sites

×
×
  • Create New...