Jump to content

Ignoring If/Else Statement


maxudaskin

Recommended Posts

Hi guys,

I'm customizing an OpenCart template that is riddled with programming bugs. It is MVC and I am having a really odd issue with a controller file.

 

The template that I want to use is not loading. I have edited the one in the selected template and also the default, but no avail. I was troubleshooting why it wasn't working and I came to the conclusion that either I am completely blind or stupid, or PHP is all of a sudden a troll.

 

Please let me know if you need more context, but here is a snippet of the code and the result. I am really at a loss right now.

 

Result:

14

Code:

echo "1";

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) {
	echo "2";die();
	$this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/category.tpl', $data));
} else {
	echo "3";die();
	$this->response->setOutput($this->load->view('default/template/product/category.tpl', $data));
}
echo "4";die();
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.