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

Redirect to Product Page when only One product in category

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #41  
Old 10-11-2012, 10:29 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Redirect to Product Page when only One product in category

Search engines don't like pages that load, and then do a refresh. This technique used to be quite popular in the early days where people would create doorway pages and then use javascript or meta refresh to redirect. Such redirects are also common with virus that try to hijack the user sending them away from their intended destination. More recently, some similar things have been done for the purpose of "302 Hijacking."

Here's an expert from someone who works at Google, I believe it was John Mueller:

Quote:
I would strongly recommend not using meta refresh-type or JavaScript redirects like that if you have changed your URLs. Instead of using those kinds of redirects, try to have your server do a normal 301 redirect. Search engines might recognize the JavaScript or meta refresh-type redirects, but that's not something I would count on -- a clear 301 redirect is always much better.

Personally, I would either:

1) Do nothing. Have the user click on my category, then click on my one product. This allows the category and my page to be indexed, so that in the future if and when I do add more items to the category, the category is indexed.

2) Customize my navigation so that when there is only one item in a category, it automatically links to the product in the navigation by replacing the category url with the product url.

3) Customize my category code in php to check the product count in a category, and do a 301 redirect to the product if the category has one item. I would code this so that it happens automatically.

I would recommend #1 or #3 but wouldn't recommend the method in this thread for anyone no matter if they are using CDSEO or not (though the previous code provided in this thread for CDSEO should work for anyone who chooses to do so).
Reply With Quote
  #42  
Old 10-11-2012, 10:33 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Redirect to Product Page when only One product in category

+1, I don't like this. As a customer I would be annoyed if I click on category and expect to see its page but instead I am redirected to another part of the store - this is not what I wanted. If you think page is too empty with one product you can show some ads or links to other similar products on that page.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #43  
Old 10-11-2012, 10:37 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Redirect to Product Page when only One product in category

Quote:
Originally Posted by cflsystems
+1, I don't like this. As a customer I would be annoyed if I click on category and expect to see its page but instead I am redirected to another part of the store - this is not what I wanted. If you think page is too empty with one product you can show some ads or links to other similar products on that page.

And/or add some keyword rich paragraphs of useful text
Reply With Quote
  #44  
Old 10-11-2012, 11:01 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Redirect to Product Page when only One product in category

Quote:
Originally Posted by cflsystems
+1, I don't like this. As a customer I would be annoyed if I click on category and expect to see its page but instead I am redirected to another part of the store - this is not what I wanted. If you think page is too empty with one product you can show some ads or links to other similar products on that page.

Steve,

How does the customer know (or care) that it's a category (or a product)?

Think like the customer -- they simply want to easily browse my products. They don't care if I have 1 item in a "category" or a dozen.

Then think like a merchant - I want to put similar items that a customer may want near each other, without asking the customer to browse or click any more than minimum. I also want the navigation to be CRYSTAL clear.

Then think like a developer -- until x-cart allows me to place individual products in a category menu, how can we achieve integrated navigation to a PRODUCT from the main menu?

For example, I am in the cosmetics business. One of our product categories is "makeup kits". These are my top-sellers. I want IMMEDIATE access to these top-performing skus, without a 2nd click. A flyout works perfectly for this. But the xcart system doesn't allow me to assign PRODUCTS to the flyouts, without speed-bump to the category page. If I have 5 top-selling kits - WHY NOT use this technique, and simply make it easier for the customer to go directly to the product they want?

Jon - are you certain that this code does a 302? The term "redirect" is what moneysaver67 used when he contributed this code 6 years ago. I used it in the comments when I rephrased it for newer xcarts. In post #29, you said

Quote:
For CDSEO Pro you can use the default code and the url will 301 redirect to the CDSEO Pro url

http://forum.x-cart.com/showpost.php?p=254957&postcount=29

Code:
{if $products|@count eq 1} {assign var="prodURL" value="`$http_location`/`$products.0.page_url`"} {php} header( "Location: " . $GLOBALS[smarty]->_tpl_vars[prodURL] ); {/php} {/if}

ESPECIALLY with CDSEO PRO, I see no reason why not to use this for merchandising your top selling items, if appropriate for the store's catalog and customers. Technically, what's the difference between this and a true 301? Until xcart (or a mod developer) allows the merchant to put any item into the main flyouts at any place -- why the hell not?

PS -- more text doesn't always sell products in fashion and beauty. IMAGES sell. Text is king for search, but until my customer can see the product (in a more perfect world, toch it), I don't have a chance. The faster I can get my customer to looking at the product page, the better shot I have of conversion. Obviously. Obviously?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #45  
Old 10-11-2012, 11:22 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Redirect to Product Page when only One product in category

Ah... this code does a 302 (just checked)

But that shouldn't matter, since the PAGE is indexed. The "category" is simply a placeholder for browsing. As far as I'm concerned, I DO NOT WANT the "hidden" category page indexed, nor do I want any link juice from it.
SO this works perfectly for my needs!
We link to the PRODUCT PAGE from many other places, and the ONLY URL people see is the CDSEO URL.

I am not convinced this is not a great way to merchandise certain products.

PS -- my PRODUCT PAGE is ranked sky-high for many keywords. ANd we have a relevant Sitelinks on goog and bing. Can't ask for more.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #46  
Old 10-11-2012, 11:28 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Redirect to Product Page when only One product in category

It could be just me but I just don't like it when I click on a link and I have some idea where it will take be but instead I am being redirected to another url. Customers may not know if that page should be category or product but they can see what the link url is and what the final url is. They may not care though or not pay attention to this. I do

It's like I ask you to show me all products from "kits" section but you instead of saying "there is the section and we have one product available" you are saying - this is the product from the "kits" section.

Also if I browse the store and see all cats pages with products but then click on particular one and instead of cat page with product(s) I see product details page I may think something is wrong there - why this link which should be like the others in the menu follows different path...

Again - this is me. If this approach works for you and converts that is the important thing right
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #47  
Old 10-11-2012, 11:39 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Redirect to Product Page when only One product in category

Determine what is best and then customize it to make it happen instead of trying to work within the existing framework.

If you want products in your menu, you can customize it to have products in your menu
Reply With Quote
  #48  
Old 10-11-2012, 11:41 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Redirect to Product Page when only One product in category

When I mentioned a 301, I meant from product.php?productid=X to the CDSEO url.

This code will return a 302 first because it loads content and then redirects.
Reply With Quote
  #49  
Old 10-11-2012, 11:47 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Redirect to Product Page when only One product in category

Quote:
Originally Posted by cflsystems
It could be just me but I just don't like it when I click on a link and I have some idea where it will take be but instead I am being redirected to another url

But Steve..
What if I named my categories, "Our Products" and you simply don't have ANY idea if a link is a product or a category? You can't be surprised if you click on a flyout for something that interests you, and it's exactly what it says. And that's what you were expecting.

Take off the developer hat -- you have NO IDEA and no expectation that the first line of browsing is going to be categories or products or sub-cats or a link to somewhere else.

Walmart.com does this.
So do other billion $ brands.
I think it's good merchandising. Help the customer find what they want - not preserve order of the category hierarchy.

My $.02 too.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #50  
Old 10-11-2012, 11:55 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Redirect to Product Page when only One product in category

Difference of opinion. Fortunatelly for me I don't shop at Walmart

Yes if it works it works
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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 10:48 AM.

   

 
X-Cart forums © 2001-2020