Jump to content

MODULE Block new products Limit Left column


Blawdi

Recommended Posts

  • 4 months later...

open module .php file, there is a code like:

	public function hookRightColumn($params)
	{
		if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId()))
		{
			if (!isset(BlockNewProducts::$cache_new_products))
				BlockNewProducts::$cache_new_products = $this->getNewProducts();

			$this->smarty->assign(array(
				'new_products' => BlockNewProducts::$cache_new_products,
				'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
				'homeSize' => Image::getSize(ImageType::getFormatedName('home'))
			));
		}

		if (BlockNewProducts::$cache_new_products === false)
			return false;

		return $this->display(__FILE__, 'blocknewproducts.tpl', $this->getCacheId());
	}

change it to:

	public function hookRightColumn($params)
	{
		if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId()))
		{
			if (!isset(BlockNewProducts::$cache_new_products))
				BlockNewProducts::$cache_new_products = $this->getNewProducts();

			$this->smarty->assign(array(
				'new_products' => Product::getNewProducts((int) $this->context->language->id, 0, 15),
				'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
				'homeSize' => Image::getSize(ImageType::getFormatedName('home'))
			));
		}

		if (BlockNewProducts::$cache_new_products === false)
			return false;

		return $this->display(__FILE__, 'blocknewproducts.tpl', $this->getCacheId());
	}

where 15 is a number of products you want to display

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...