Post by civanescu » Fri Dec 08, 2017 9:05 pm

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>

Newbie

Posts

Joined
Wed Dec 09, 2015 6:28 pm

Post by straightlight » Fri Dec 08, 2017 9:58 pm

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 16 guests