Jump to content

how to change quick_view block from my costom module hook/*.tpl file


Recommended Posts

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 by ZiedDams (see edit history)
Link to comment
Share on other sites

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 by Crezzur (see edit history)
  • Thanks 1
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...