jeandelima Posted December 9, 2013 Share Posted December 9, 2013 (edited) 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. Edited December 9, 2013 by jeandelima (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 9, 2013 Share Posted December 9, 2013 I used a hook what hook you used? Link to comment Share on other sites More sharing options...
jeandelima Posted December 9, 2013 Author Share Posted December 9, 2013 (edited) 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 December 9, 2013 by jeandelima (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now