Jump to content

Subcategory link directly to its only product


Sami59100
 Share

Recommended Posts

Hi

 

I have category page, with all its subcategories. And i'd like that when someone click on a subcategory, he is redirected automatically to the only product of a category.

 

Because each subcategories has only one product, so I find it weird to arrive in a page with only one product listed, and having to click again.

 

I want to delete a step.

 

I've looked it up but can't find a way to do it, is it possible ? If yes, how ?

 

Thanks !

Share this post


Link to post
Share on other sites

Yes, but I'd have to do it manually for every product, and modify the .htaccess everytime I change products.

 

I was looking for something to modify in the Category controller. I was thinking get the number of products in the subcategory in the controller, pass it to template, and in the template, if I see a  subcategory with only one product, I directly link to the product instead of the category.

 

But I don't know how to do this, or if there is a bette way to do it.

 

Thanks !

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More