Jump to content

Show not active products page


Recommended Posts

Hello, can some one help with this problem:


My client have shop, and for seo need change prestashop to show not active products pages.




Client have prestashop 1.4 and his products periodically become inactive and this products hide from category product list, but he want to have these items remain accessible for a direct link for seo.


Can some1 tell me how can i do that?


Link to comment
Share on other sites

you can create custom url with get variable


and then modify the related Controller files


For example :

CategoryController.php  - function assignProductList()  - set param $active = false

// set param $active = true
      $this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay, false, false);
      $this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay);

ProductController.php - function init() - force to set inactive product as active before object validation

if ($id_product = (int)Tools::getValue('id_product'))
  $this->product = new Product($id_product, true, $this->context->language->id, $this->context->shop->id);

// force to set inactive product as active
    $this->product->active = true;
Edited by gonebdg - webindoshop.com (see edit history)
  • Like 1
Link to comment
Share on other sites

First very big thx for your answer and your desire to help me!


I think this link:



not the same link for seo with that:



or im wrong?


Or in .htaccess i must do 301 redirect from site.com/category/12807-product.html?showInactive to site.com/category/12807-product.html some how?


Just what happen if "search robot" go on site by old link? or customer press that link in search result?

Edited by Kerm (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...