Jump to content

Presta - v1.7.1.2 : Module, display() retrun nothing...


Recommended Posts

Hello,

 

I try to display with the call of the display() method in the getContent() method a .tpl file but the configuration page of the module remains white ...

 

The .tpl file is located in mymodcomments / views / templates / hook / getContent.tpl

 

Here is the code

class MyModComments extends Module
{
    public function __construct()
    {
        $this->name = 'mymodcomments';
        $this->tab = 'front_office_features';
        $this->version = '0.1';
        $this->displayName = 'Module of product comments';
        $this->description = 'With this module, customers will be able to grade and comments products.';

        parent::__construct();

        $this->bootstrap = true;
    }

    public function processConfiguration()
    {
        if (Tools::isSubmit('mymod_pc_form'))
        {
            $enable_grades = Tools::getValue('enable_grades');
            $enable_comments = Tools::getValue('enable_comments');
            Configuration::updateValue('MYMOD_GRADES', $enable_grades);
            Configuration::updateValue('MYMOD_COMMENTS', $enable_comments);
        }
    }

    public function getContent()
    {
        return $this->display(__FILE__, 'getContent.tpl');
    }
}

Thanks for your help :)

 

Link to comment
Share on other sites

Hi 

 

Welcome to the forum. That reminds me of code from Fabien Serny's book, but that is for 1.6 version. 

And 1.7 do bring some changes. Do check developer documentation 

http://developers.prestashop.com/

http://developers.prestashop.com/module/80-Updating/index.html

http://developers.prestashop.com/module/40-Widgets/widget.html?highlight=widget

 

But also for 1.7 do check PrestaShop native modules that starts with ps_

https://github.com/PrestaShop?utf8=%E2%9C%93&q=ps_&type=&language=

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...