I've been change not_found.tpl design into 404 error page not found. When i'm done, i noticed that empty cart is showing 404 eror page, also the empty download and empty purchase history page.
Is there any simply way to make 404 error page? or we need to duplicate the not_found.tpl ?
If someone had post this and resolved, please tell me the link.
Thanks for your help..
Regards,
Qahar
Is there any simply way to make 404 error page? or we need to duplicate the not_found.tpl ?
If someone had post this and resolved, please tell me the link.
Thanks for your help..
Regards,
Qahar
Last edited by qahar on Wed Oct 06, 2010 4:01 am, edited 1 time in total.
Solved, the main ide is how to separate error page (not found) and empty page (empty cart, download and history).
1. Open stylesheet.css
add:
2. Open: not_found.tpl
Find class "middle", duplicate and give different ID
3. Still on: not_found.tpl
before <?php echo $footer; ?> add this:
4. what this use for?
- if some one go to empty cart page, they will see not_found.tpl message: Your shopping cart is empty!
- if they visit the unavailable page (info or category, they will see: the not found message + your suggestion
note: but i think this will not work with seo site
1. Open stylesheet.css
add:
Code: Select all
.hidden {display:none;}
Find class "middle", duplicate and give different ID
Code: Select all
<div id="empty" class="middle hidden">
<div class="content"><?php echo $text_error; ?></div>
<div class="buttons">
<table>
<tr>
<td align="right"><a onclick="location = '<?php echo str_replace('&', '&', $continue); ?>'" class="button"><span><?php echo $button_continue; ?></span></a></td>
</tr>
</table>
</div>
</div>
<div id="notfound" class="middle hidden">
<div class="content">
<p>Why this happen: <?php echo $text_error; ?></p>
<p>May be you can find what you need on:</p>
<ol>
<li>link to sitemap</li>
<li>link to advanced search</li>
</ol>
</div>
<div class="buttons">
<table>
<tr>
<td align="right"><a onclick="location = '<?php echo str_replace('&', '&', $continue); ?>'" class="button"><span><?php echo $button_continue; ?></span></a></td>
</tr>
</table>
</div>
</div>
before <?php echo $footer; ?> add this:
Code: Select all
<script type="text/javascript"><!--
$(document).ready(function() {
route = getURLVar('route');
if (route == 'checkout/cart') {
$('#empty').removeClass('hidden');
} else if (route == 'account/download') {
$('#empty').removeClass('hidden');
} else if (route == 'account/history') {
$('#empty').removeClass('hidden');
} else {
$('#notfound').removeClass('hidden');
}
});
//--></script>
- if some one go to empty cart page, they will see not_found.tpl message: Your shopping cart is empty!
- if they visit the unavailable page (info or category, they will see: the not found message + your suggestion
note: but i think this will not work with seo site
@qahar - Any chance you've updated your code to work with v1.5.2.1? Thanks!
~
Install Extensions OR OpenCart Fast Service! PayPal Accepted
I will professionally install and configure any free or purchased theme, module or extension.
Visit http://www.mrtech.ca if you need an OpenCart webmaster
~
MrTech wrote:@qahar - Any chance you've updated your code to work with v1.5.2.1? Thanks!
May be next week I will make tutorial on this.rajithg wrote:is it possible to create a custom 404 error page with images stc.. in open cart....?
I know this is an old thread but I thought I would post my solution for the benefit of others.
I am not really a fan of hiding text via CSS unless this is required from a functional perspective such as drop down menu's etc.
Why not just use PHP if statements to check against the desired page and insert the custom code accordingly?
For example, in catalog/view/theme/*/template/error/not_found.tpl
Replace
With
Obviously you could do this with as much of the template code as you like, including the entire template if you choose to. The section above is only an example.
I am not really a fan of hiding text via CSS unless this is required from a functional perspective such as drop down menu's etc.
Why not just use PHP if statements to check against the desired page and insert the custom code accordingly?
For example, in catalog/view/theme/*/template/error/not_found.tpl
Replace
Code: Select all
<div class="content"><?php echo $text_error; ?></div>
Code: Select all
<?php if ((isset($this->request->get['route']) && $this->request->get['route'] == 'error/not_found')) { ?>
<div class="content">
<!--Insert your custom design here-->
</div>
<?php } else { ?>
<div class="content"><?php echo $text_error; ?></div>
<?php } ?>
@eWarrior:
I was looking through my server logs last night and noticed that several shoppers had been continuously trying to click the "checkout" link. I found that behavior curious, so I tried it too. Imagine my shock when I saw my customized 404 page come up!
I determined the 404 page only displayed when the cart was empty, and today, I found your solution. I tried it and it worked perfectly!
Thank you SO MUCH for that pearl of wisdom. I'll be checking out your profile to see if you have authored any OpenCart plug-ins that I can purchase as a thank you.
I was looking through my server logs last night and noticed that several shoppers had been continuously trying to click the "checkout" link. I found that behavior curious, so I tried it too. Imagine my shock when I saw my customized 404 page come up!
I determined the 404 page only displayed when the cart was empty, and today, I found your solution. I tried it and it worked perfectly!
Thank you SO MUCH for that pearl of wisdom. I'll be checking out your profile to see if you have authored any OpenCart plug-ins that I can purchase as a thank you.
Who is online
Users browsing this forum: No registered users and 149 guests