Post by ianhaney » Tue Oct 08, 2019 1:09 am

I am trying to create a custom page in opencart 2.0.3.1 but getting the following error on the page when visited in the browser

Notice: Error: Could not load template catalog/view/theme/target/builder! in vqmod/vqcache/vq2-system_modification_system_engine_loader.php on line 45

I created a php file called builder.php in a folder called target in the folder catalog/controller/target/
I then created a language php file called builder.php in catalog/language/english/target/
I then created a tpl file called builder.tpl in catalog/view/theme/default/target/

Then in admin I create a new layout called Target System Builder with a route target/builder

I have attached the files to this post. EDIT It won't let me attach the tpl file

Can anyone help to see where I have gone wrong please

Active Member

Posts

Joined
Sun Jun 24, 2012 2:30 am

Post by ianhaney » Tue Oct 08, 2019 5:33 am

Sorted the new page and is working all ok now

Active Member

Posts

Joined
Sun Jun 24, 2012 2:30 am

Post by webdev1 » Fri Oct 11, 2019 12:54 pm

What was wrong with it and how did you solve it?

Newbie

Posts

Joined
Tue Aug 08, 2017 1:14 pm

Post by ianhaney » Tue Oct 29, 2019 7:17 pm

Sorry for the late reply, I don't get notified when I get replies to posts

The issue was I had the following code

Code: Select all

// OpenCart 2.1 and below CHOOSE ACCORDINGLY
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/target/builder.tpl')) { //if file exists in your current template folder
      $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/target/builder.tpl', $data)); //get it
    } else {
      $this->response->setOutput($this->load->view('default/template/target/builder.tpl', $data)); //or get the file from the default folder
    }
    
    // OpenCart 2.2 and above CHOOSE ACCORDINGLY
    $this->response->setOutput($this->load->view('target/builder', $data)); 
so took out the following lines and worked after that

Code: Select all

// OpenCart 2.2 and above CHOOSE ACCORDINGLY
    $this->response->setOutput($this->load->view('target/builder', $data)); 

Active Member

Posts

Joined
Sun Jun 24, 2012 2:30 am
Who is online

Users browsing this forum: No registered users and 36 guests