Jump to content

How To Redirect All Product Pages To Category Pages?


annunakiwww

Recommended Posts

Hmm, How should we see this? Do you have products at all in your shop?

 

If so, how would you add these products to your cart from a category page?

 

If you don't have products. You will automatically 'get stuck' at category level...

 

Just some thoughts. Please elaborate...

Link to comment
Share on other sites

Hi, many thanks for your reply, for some reason I missed it.

 

There's an 'add to cart' button on the category pages (at least in the 1.4 template), so that's no problem. There's no extra information on the product page besides the short description that's already on the category page, so I want to keep my shop clean and navigation easy by just navigating on the category pages. However, links (e.g. in the search function) refer to product pages, so I want to redirect them automatically to the category page where the customer bought that item.

Link to comment
Share on other sites

In fact, I got it working by adding the following code (PS 1.4.10) to ProductController.php on line 172

//start
$rewrited_url = self::$link->getCategoryLink((int)$category->id, $category->link_rewrite);
header ("Location: $rewrited_url");
//end

However:

- this modifies a core file and will get lost during an upgrade. Does anybody know how to put this in an override?

- is this even the safest and/or fastest way to do it? I found it takes somewhat longer for the category page to load afterwards ...

Link to comment
Share on other sites

  • 11 months later...

i am looking to redirect a product page simply to include the category in the link. For example: www.ApostolicClothing.com/iris.html should be www.ApostolicClothing.com/skirts/iris.html

 

Hope that makes sense. I know how to change the SEO to include the category but due to our social media presence, i dont want all of our outside links to go bad. 

 

ANY HELP WOULD BE APPRECIATED. 

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