4140 Posted June 12, 2011 Share Posted June 12, 2011 I am getting too many 404's and that's not very good in google's eyes.I want to be able to remove products from the catalog, without deleting their page. This way the products list would display only products which could be purchased, but the ones not available would still be there for Google to crawl.Suggestions? Link to comment Share on other sites More sharing options...
shokinro Posted June 12, 2011 Share Posted June 12, 2011 You do it as following1. disable the product in back office. 2. change this file to make the product page still show it.prestaShop 1.4x in followingYourSiteRoot/controllers/productController.phpFind this code if (!Validate::isLoadedObject($this->product) OR (!$this->product->active AND (Tools::getValue('adtoken') != Tools::encrypt('PreviewProduct'.$this->product->id)) || !file_exists(dirname(__FILE__).'/../'.Tools::getValue('ad').'/ajax.php'))) { header('HTTP/1.1 404 page not found'); $this->errors[] = Tools::displayError('Pproduct is no longer available.'); } elseif (!$this->product->checkAccess((int)(self::$cookie->id_customer))) $this->errors[] = Tools::displayError('You do not have access to this product.'); And removed following code if (!Validate::isLoadedObject($this->product) OR (!$this->product->active AND (Tools::getValue('adtoken') != Tools::encrypt('PreviewProduct'.$this->product->id)) || !file_exists(dirname(__FILE__).'/../'.Tools::getValue('ad').'/ajax.php'))) { header('HTTP/1.1 404 page not found'); $this->errors[] = Tools::displayError('Pproduct is no longer available.'); } else You are all set.This way, the product is displayed, but user still not able to order it.hope is works for you Link to comment Share on other sites More sharing options...
4140 Posted June 13, 2011 Author Share Posted June 13, 2011 I think that's it. Thanks! Link to comment Share on other sites More sharing options...
Welpix Posted September 14, 2011 Share Posted September 14, 2011 how can I redirect the "Product is no longer available" to custom page in CMS ? Link to comment Share on other sites More sharing options...
mmsh Posted November 8, 2011 Share Posted November 8, 2011 hi, please... how to redirect after the "Product is no longer available" in x seconds? for example 1-2 seconds after that... or completely bypass? thanks Link to comment Share on other sites More sharing options...
mmsh Posted November 8, 2011 Share Posted November 8, 2011 is it enough to change header('HTTP/1.1 404 page not found'); with... header("Location: http://www.example.com/"); ??? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now