ZiedDams Posted July 16, 2021 Share Posted July 16, 2021 i create a module with register of 'displayProductPriceBlock' hook , then i create a function that use that hook so i can add element inside it . but it do'nt seem to work any help ? Link to comment Share on other sites More sharing options...
SmartDataSoft Posted July 17, 2021 Share Posted July 17, 2021 @ZiedDams Which version of PrestaShop you are try to do it. PrestaShop 1.7 and 1.6 template call is different. You can check this doc https://devdocs.prestashop.com/1.7/modules/creation/displaying-content-in-front-office/ Thank you 1 Link to comment Share on other sites More sharing options...
ZiedDams Posted July 19, 2021 Author Share Posted July 19, 2021 (edited) On 7/17/2021 at 7:36 PM, SmartDataSoft said: @ZiedDams Which version of PrestaShop you are try to do it. PrestaShop 1.7 and 1.6 template call is different. You can check this doc https://devdocs.prestashop.com/1.7/modules/creation/displaying-content-in-front-office/ Thank you thank you for your time, im using 1.7 Edited July 19, 2021 by ZiedDams (see edit history) Link to comment Share on other sites More sharing options...
delete-account-pleas Posted July 19, 2021 Share Posted July 19, 2021 (edited) You just need to use the display option in the correct way return $this->display(__FILE__, 'fav-product-btn.tpl'); Like you can see in the example of the devdocs url provided by @SmartDataSoft Quote We will create the mymodule.tpl file, which was passed as a parameter of the display() method in our module’s code, in the hookDisplayHome() method. When calling a template from within a hook, PrestaShop looks for that template file in the /views/templates/hook/ folder (in the module’s folder), which you must create yourself. <?php public function hookDisplayLeftColumn($params) { $this->context->smarty->assign([ 'my_module_name' => Configuration::get('MYMODULE_NAME'), 'my_module_link' => $this->context->link->getModuleLink('mymodule', 'display') ]); return $this->display(__FILE__, 'mymodule.tpl'); } Edited July 19, 2021 by Crezzur (see edit history) 1 Link to comment Share on other sites More sharing options...
SmartDataSoft Posted July 19, 2021 Share Posted July 19, 2021 @ZiedDams you can check this solution , full example with code. i just found the post. Thank you 1 Link to comment Share on other sites More sharing options...
ZiedDams Posted July 19, 2021 Author Share Posted July 19, 2021 thank you @SmartDataSoft and @Crezzur it finally work perfectly for me 😃 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