Jump to content

How to automatically redirect product page to category page?


annunakiwww

Recommended Posts

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

  • 2 weeks later...

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...