Jump to content

How to Add Favorite Products on Featured Products page?


Recommended Posts

Hi!

 

I need to insert a button to add products to your favorites on my homepage, where are displayed the featured products.

I used a hook, but it was not as I expected. Does anyone know how to do this?

 

The link is not working...

 

Thank you!!!

 

The images are as accurate as is and display.

post-732748-0-07241100-1386605717_thumb.png

post-732748-0-49349600-1386606833_thumb.png

Edited by jeandelima (see edit history)
Link to comment
Share on other sites

I created a new hook with the following parameters:

public function hookprodutosFavoritos($params)
    {
        include_once(dirname(__FILE__).'/FavoriteProduct.php');

        $this->smarty->assign(array(
            'isCustomerFavoriteProduct' => (FavoriteProduct::isCustomerFavoriteProduct($this->context->customer->id, Tools::getValue('id_product')) ? 1 : 0),
            'isLogged' => (int)$this->context->customer->logged,
        ));
        return $this->display(__FILE__, 'favoriteproducts-extra.tpl');
    }

And within homefeatured.tpl file insert this: {hook h='produtosFavoritos'}

I learned to do it this way in a video, worked with the newsletter block, but the block of favorite products came this error.

 
I also used the registry hook function module installation, as I did with the newsletter
 
public function install()
	{
			if (!parent::install()
				|| !$this->registerHook('displayMyAccountBlock')
				|| !$this->registerHook('displayCustomerAccount')
				|| !$this->registerHook('displayLeftColumnProduct')
				|| !$this->registerHook('produtosFavoritos') //HERE
				|| !$this->registerHook('extraLeft')
				|| !$this->registerHook('displayHeader'))
					return false;

 

Edited by jeandelima (see edit history)
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...