annunakiwww Posted February 4, 2012 Share Posted February 4, 2012 Hi, My shop works exclusively on category pages instead of product pages, hence I need a way to redirect product pages to category pages. In Prestashop 1.2.5 I found a fix, i.e. post the following lines in product.php: if (($category->id) != 192) { // Change to the URL you want to redirect to $URL=$link->getCategoryLink($category->id, $category->link_rewrite); header ("Location: $URL"); } However, in 1.4.x, placing this in product.php or the productcontroller doesn't work. Any suggestions? Here's a topic on the reverse order, i.e. from category page to product page: http://www.prestashop.com/forums/topic/42046-tip-automatically-redirect-a-category-with-only-1-product-to-the-product-page/ Thanks in advance for any tips! Link to comment Share on other sites More sharing options...
annunakiwww Posted February 4, 2012 Author Share Posted February 4, 2012 Found it, add $rewrited_url = self::$link->getCategoryLink((int)$category->id, $category->link_rewrite); header ("Location: $rewrited_url"); in the productcontroller.php, around line 173 Link to comment Share on other sites More sharing options...
pelingier Posted February 14, 2012 Share Posted February 14, 2012 Hey thanks works great but is it also possible to redirect to the sub category product list? 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