Jump to content

[Solved] New product block in displayHome


blackflow
 Share

Recommended Posts

Hi, I was tinkering with the "new product block" and found a way to successfully transplant "new product block" to home content (displayHome) and not only to tab content. To do so just add this to blocknewproduct.php (around 137).

 public function hookDisplayHome($params)
    {
        if (!$this->isCached('blocknewproducts_home.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_home.tpl', $this->getCacheId());
    }

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More