if page you requested then display code else opencart 2
Posted: Sat Jun 15, 2024 4:53 pm
I am trying to modify the error/not_found page but found out the empty shopping cart and some other pages use that template as well so the same code ends up on the The page you requested cannot be found! and also empty shopping cart content.
I am trying to make a custom 404 page and found a topic for opencart 1.5 that I could use php if and else statements but it don't seem to work, it still displays the same content on both page you requested cannot be found! and also empty shopping cart
Below is what I have in error/not_found.tpl file
Should I need to do something in the controller file or will it just not work because they use the same template file.
I am using 2.3.0.2
I am trying to make a custom 404 page and found a topic for opencart 1.5 that I could use php if and else statements but it don't seem to work, it still displays the same content on both page you requested cannot be found! and also empty shopping cart
Below is what I have in error/not_found.tpl file
Code: Select all
<?php if (!isset($this->request->get['route']) || (isset($this->request->get['route']) && $this->request->get['route'] == 'error/not_found')) { ?>
<div id="content" class="col-sm-12">
<h1><?php echo $heading_title; ?></h1>
<p>NOT FOUND PAGE NEW</p>
<?php } else { ?>
<div id="content" class="<?php echo $class; ?>">
<?php echo $content_top; ?>
<h1><?php echo $heading_title; ?></h1>
<p><?php echo $text_error; ?></p>
<?php echo $content_bottom; ?>
</div>
<?php echo $column_right; ?>
<?php } ?>
I am using 2.3.0.2