Kerm Posted October 9, 2013 Share Posted October 9, 2013 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 More sharing options...
Kerm Posted October 11, 2013 Author Share Posted October 11, 2013 up Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted October 11, 2013 Share Posted October 11, 2013 (edited) you can create custom url with get variable http://domain.com/categoryPage?showInactive http://domain.com/category/productPage?showInactive and then modify the related Controller files For example : CategoryController.php - function assignProductList() - set param $active = false // set param $active = true if(Tools::isSubmit('showInactive')) $this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay, false, false); else $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 if(Tools::isSubmit('showInactive')) $this->product->active = true; Edited October 11, 2013 by gonebdg - webindoshop.com (see edit history) 1 Link to comment Share on other sites More sharing options...
Kerm Posted October 11, 2013 Author Share Posted October 11, 2013 (edited) First very big thx for your answer and your desire to help me! I think this link:site.com/category/12807-product.html not the same link for seo with that:site.com/category/12807-product.html?showInactive 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 October 11, 2013 by Kerm (see edit history) Link to comment Share on other sites More sharing options...
Kerm Posted October 16, 2013 Author Share Posted October 16, 2013 up Link to comment Share on other sites More sharing options...
Kerm Posted October 21, 2013 Author Share Posted October 21, 2013 Please help me -/ bump 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