Jump to content

How to make a custom error page?


Recommended Posts

I want to change the error page for products that have been disabled to something better than just

 

'Error 1 - Product is no longer available'

 

I would like to change it so that it will still say that the product is not available but suggest some other random products that are in stock as alternatives.

 

Anyone know how i can do this?

Link to comment
Share on other sites

  • 1 year later...

I want to change the error page for products that have been disabled to something better than just

 

'Error 1 - Product is no longer available'

 

I would like to change it so that it will still say that the product is not available but suggest some other random products that are in stock as alternatives.

 

Anyone know how i can do this?

Yes, I know. It's an old question, but I'm new in this place.

You can try to use jquery for this. I haven't tried it but could do the work. Add this to errors.tpl under your theme.

 

<script type="text/javascript">
$(document).ready(function() {
 if($('.error ol li').html()=='Product is no longer available'){
//do custom code, redirect, change html content of error or whatever other thing
}
});
</script>

Edited by J.C.P. (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...