wildcherry Posted November 22, 2013 Share Posted November 22, 2013 PS 1.5.6 Default theme. I'm working on local server, on a Mac. I checked the module "Favourites" in BO: it's there. Installed. So I don't understand why it's not displaying in front office. Link to comment Share on other sites More sharing options...
wildcherry Posted November 23, 2013 Author Share Posted November 23, 2013 I've checked Blockmyaccount.tpl There's no Favourite. But when I click on My account on the Front Office, I get Favourite at the end of the list. I guess it should display in the home page too...cause a customer is not supposed to chase his Favourites on the website... Any help please? Link to comment Share on other sites More sharing options...
vekia Posted November 24, 2013 Share Posted November 24, 2013 hello, you're talking about "Favorite products" module ? checm please modules> positions tab in your back oggice, this module should appears there about 8 times (different positions) Link to comment Share on other sites More sharing options...
wildcherry Posted November 24, 2013 Author Share Posted November 24, 2013 Hello, the "favourite products" module is in the following positions: My account block New elements in the product page (left column) Pages header Customer account displayed in front office So only 4 positions... Link to comment Share on other sites More sharing options...
vekia Posted November 24, 2013 Share Posted November 24, 2013 oops my bad, you've got right, it should be added to hooks you described. nothing more Link to comment Share on other sites More sharing options...
wildcherry Posted November 24, 2013 Author Share Posted November 24, 2013 What should I do to make it display in Homepage? Like for example in My account in the footer? Link to comment Share on other sites More sharing options...
vekia Posted November 25, 2013 Share Posted November 25, 2013 you need to transplant module to displayMyAccountBlockfooter hook but before that it will be necessary to create function to handle this hook in favoriteproducts module .php file (public function hookdisplayMyAccountBlockfooter($params) ) Link to comment Share on other sites More sharing options...
wildcherry Posted November 26, 2013 Author Share Posted November 26, 2013 Thanks for your help. Unfortunately I'm not that good in creating funtions... Don't you think there is something wrong?..since the following is my Favoriteproducts.php if (!defined('_CAN_LOAD_FILES_')) exit; class FavoriteProducts extends Module { public function __construct() { $this->name = 'favoriteproducts'; $this->tab = 'front_office_features'; $this->version = 1.0; $this->author = 'PrestaShop'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Favorite Products'); $this->description = $this->l('Display a page featuring the customer\'s favorite products.'); } public function install() { if (!parent::install() || !$this->registerHook('displayMyAccountBlock') || !$this->registerHook('displayCustomerAccount') || !$this->registerHook('displayLeftColumnProduct') || !$this->registerHook('extraLeft') || !$this->registerHook('displayHeader')) return false; if (!Db::getInstance()->execute(' CREATE TABLE `'._DB_PREFIX_.'favorite_product` ( `id_favorite_product` int(10) unsigned NOT NULL auto_increment, `id_product` int(10) unsigned NOT NULL, `id_customer` int(10) unsigned NOT NULL, `id_shop` int(10) unsigned NOT NULL, `date_add` datetime NOT NULL, `date_upd` datetime NOT NULL, PRIMARY KEY (`id_favorite_product`)) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8')) return false; return true; } public function uninstall() { if (!parent::uninstall() || !Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'favorite_product`')) return false; return true; } public function hookDisplayCustomerAccount($params) { $this->smarty->assign('in_footer', false); return $this->display(__FILE__, 'my-account.tpl'); } public function hookDisplayMyAccountBlock($params) { $this->smarty->assign('in_footer', true); return $this->display(__FILE__, 'my-account.tpl'); } public function hookDisplayLeftColumnProduct($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'); } public function hookDisplayHeader($params) { $this->context->controller->addCSS($this->_path.'favoriteproducts.css', 'all'); $this->context->controller->addJS($this->_path.'favoriteproducts.js'); return $this->display(__FILE__, 'favoriteproducts-header.tpl'); } } and it looks like "favorite" should display in the header in the homepage, but I don't have any Favorite in the home page... 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