Jump to content

Insert Special Products on the place of New Products


kumarji

Recommended Posts

Hello

i want to Insert Special Products block on the place of New products.

 

I want on homepage to only show all the products that are on discount .

 

 

If anyone can help me, i will be thankful.

 

 

 

 

Thanks,

 

NISCHAL

Link to comment
Share on other sites

blockspecials.php

 

change

public function install()
{
 return (parent::install() AND $this->registerHook('rightColumn')  AND $this->registerHook('header'));
}

to:

public function install()
{
 return (parent::install() AND $this->registerHook('rightColumn')  AND $this->registerHook('home') AND $this->registerHook('header'));
}

 

then

 

add function:

public function hookHome($params)

{

if (Configuration::get('PS_CATALOG_MODE'))

return ;

 

if (!($special = Product::getRandomSpecial((int)$params['cookie']->id_lang)) && !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY'))

return;

 

$this->smarty->assign(array(

'special' => $special,

'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'], 2),

'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),

));

 

return $this->display(__FILE__, 'blockspecials.tpl');

}

Link to comment
Share on other sites

thanks it works, but not fully,

 

it only shows one product that is on promotion on Home page and it shows a link at a bottom of that product to see all the products on promotion.

 

I need to show all or you can say unlimited number number of products on home page.

Link to comment
Share on other sites

in this case you have to modify the .tpl file of this addon, just remove the unwanted link + use different way to display products.

There is no other way to achieve what you want, you can do it only with modification that i suggested

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...