Jump to content

Add promotion block to left column in category view


Recommended Posts

As in the title. I would like to add a separate template for products to the left column, the one with filters, products on promotion.

I edited ps_specials.php adding 

 

public function hookDisplayLeftColumn($params)
    {
        $this->_clearCache('*');
		$this->templateFile = 'module:ps_specials/views/templates/hook/ps_specials_left.tpl';
    }

public function install()
    {
        $this->_clearCache('*');

        Configuration::updateValue('BLOCKSPECIALS_SPECIALS_NBR', 8);

        return parent::install()
            && $this->registerHook('actionProductAdd')
            && $this->registerHook('actionProductUpdate')
            && $this->registerHook('actionProductDelete')
            && $this->registerHook('actionObjectSpecificPriceCoreDeleteAfter')
            && $this->registerHook('actionObjectSpecificPriceCoreAddAfter')
            && $this->registerHook('actionObjectSpecificPriceCoreUpdateAfter')
            && $this->registerHook('displayHome')
            && $this->registerHook('hookDisplayLeftColumn');
    }

However, this did not help, I also tried to edit the hooks in the admin panel, but still nothing
I also created an additional .tpl template to reflect the view on the left side, differently styled

ekran.png.ec2e24f1b5ff3fce5451120a631808e9.png

Link to comment
Share on other sites

@Prestashop Addict

Hi. 

Thanks for your interest in the topic

Yes. I also added another item to the 'Install' function

 

public function install()
    {
        $this->_clearCache('*');

        Configuration::updateValue('BLOCKSPECIALS_SPECIALS_NBR', 8);

        return parent::install()
            && $this->registerHook('actionProductAdd')
            && $this->registerHook('actionProductUpdate')
            && $this->registerHook('actionProductDelete')
            && $this->registerHook('actionObjectSpecificPriceCoreDeleteAfter')
            && $this->registerHook('actionObjectSpecificPriceCoreAddAfter')
            && $this->registerHook('actionObjectSpecificPriceCoreUpdateAfter')
            && $this->registerHook('displayHome')
            && $this->registerHook('displayLeftColumn'); // <- new one
    }

left.thumb.png.27f1924cd2e4d79b2f6ff1acb26c0d07.png

 

However, still these views do not appear

Link to comment
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
×
×
  • Create New...