Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Category pages with single product

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 06-10-2015, 12:32 PM
 
bob@n-flatables bob@n-flatables is offline
 

Member
  
Join Date: Nov 2012
Posts: 26
 

Default 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.
__________________
X-cart v 5.2
Reply With Quote
  #2  
Old 06-10-2015, 06:05 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 06-10-2015, 06:09 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #4  
Old 06-10-2015, 06:35 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #5  
Old 06-11-2015, 05:51 AM
 
bob@n-flatables bob@n-flatables is offline
 

Member
  
Join Date: Nov 2012
Posts: 26
 

Default 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.
__________________
X-cart v 5.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020