Page 1 of 1

New module development!

Posted: Fri Dec 08, 2017 9:05 pm
by civanescu
Hi,

I'm making an "hello world" module :) . To learn about 2.3

I have the following error: Notice: Undefined variable: error_code in /var/www/html/opencart/admin/view/template/extension/module/helloworld.tpl on line 22

The way it should work is:
helloworld.php:

Code: Select all

    /* This block checks, if the hello world text field is set it parses it to view otherwise get the default hello world text field from the database and parse it*/
    if (isset($this->request->post['helloworld_text_field'])) {
        $data['helloworld_text_field'] = $this->request->post['helloworld_text_field'];
    } else {
        $data['helloworld_text_field'] = $this->config->get('helloworld_text_field');
    }   
    /* End Block*/ 
In helloworld.tpl I have:

Code: Select all

<td><textarea name="helloworld_text_field" cols="40" rows="5"><?php echo $helloworld_text_field; ?></textarea>

Re: New module development!

Posted: Fri Dec 08, 2017 9:58 pm
by straightlight
Incomplete OC version decimal. The code you are posting is not relevant to the error message you are describing. error_code is another variable that is missing in your controller.