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


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:

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>



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.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

Programmer / Opencart Tester

Legendary Member


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

Users browsing this forum: No registered users and 6 guests