X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Category pages with single product (https://forum.x-cart.com/showthread.php?t=72272)

bob@n-flatables 06-10-2015 12:32 PM

Category pages with single product
 
Is it possible to enable a category page to link directly to the product page if that category contains only one product?

In X-Cart 4, we were able to set it to do this. For instance, in "XYZ Category", we have only one product: "XYZ Product". When someone clicks on XYZ Category, I would like it to go directly to XYZ Product. If there is more than one product, obviously it would go to the category page.

totaltec 06-10-2015 06:05 PM

Re: Category pages with single product
 
Bob,
This can certainly be done. Mayube the simplest way would be a .htaccess redirect. Setup the product and category, give them both a clean URL. Then setup a redirect in your .htaccess that points the category page to the product page.

Never tried it but its worth investigating.

Alternatively we could add a text input on the category page, and if it was filled in, use that to point to the product.

cflsystems 06-10-2015 06:09 PM

Re: Category pages with single product
 
I always felt this is wrong. Customer requests a category but gets to product page instead. So you are basically advertising one thing but showing another... Not to mention how Google will feel about this redirect.

totaltec 06-10-2015 06:35 PM

Re: Category pages with single product
 
Quote:

Originally Posted by cflsystems
I always felt this is wrong. Customer requests a category but gets to product page instead. So you are basically advertising one thing but showing another... Not to mention how Google will feel about this redirect.

Agreed, it is a bad practice to continue to publish a link that is being actively redirected. Especially if done through the .htaccess as I suggested. But redirected at the PHP level, as in switching out the URL directly on the page, that would have no Google repercussions. I was just suggesting the easy way out if you only have one or two such situations.

bob@n-flatables 06-11-2015 05:51 AM

Re: Category pages with single product
 
Quote:

Originally Posted by cflsystems
I always felt this is wrong. Customer requests a category but gets to product page instead. So you are basically advertising one thing but showing another... Not to mention how Google will feel about this redirect.


I can see where you're coming from, but we want to eliminate as many steps needed to get to a product. If there's only one product in a category, it just means the customer has to load another page to get to where they want to go.


All times are GMT -8. The time now is 04:52 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.