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

One product in category, skip thumbnail page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-18-2003, 04:51 AM
  hzellers's Avatar 
hzellers hzellers is offline
 

Senior Member
  
Join Date: Mar 2003
Location: Cortland, New York
Posts: 106
 

Default One product in category, skip thumbnail page

Hey all! I have a category that just has one product in it. It seems redundant to click on the category link, then, it lists the one product so I have to click it again. Is there any way to have it skip right to the product details page if the category just has one product?

Thanks!

Heather
__________________
Thank you!
Reply With Quote
  #2  
Old 04-18-2003, 11:38 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

How about in subcategories.tpl:

{if $cat eq categorynumberwithoneproduct}
<a href="product.php?productid=yourprodnumb">
{else}
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
{/if}

__________________
ex x-cart guru
Reply With Quote
  #3  
Old 04-19-2003, 04:19 AM
  hzellers's Avatar 
hzellers hzellers is offline
 

Senior Member
  
Join Date: Mar 2003
Location: Cortland, New York
Posts: 106
 

Default

Too cool! I'm going to look like a genius and I have you to thank. Heck, everyone here does!

Heather
__________________
Thank you!
Reply With Quote
  #4  
Old 08-11-2004, 09:56 PM
 
rgbdna rgbdna is offline
 

Advanced Member
  
Join Date: Jul 2004
Posts: 31
 

Default Question

I would like to do this too...

Not working for me..I have this at the head of the subcategories.tpl

{if $cat=251}
<a href="product.php?productid=16134&cat=251&page=1">

{else}
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
{/if}


My category # is 251 and product # is 16134.

Any thoughts?

Thanks

rgbdna
__________________
v.3.10.5 Great creative direction is clarity cleverly delivered.
Reply With Quote
  #5  
Old 08-13-2004, 08:15 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Edit customer/products.php find:

Code:
if (count($products) ==0) $products="";

Add the following after it:

Code:
if(count($products)==1) { func_header_location("product.php?productid=".$products[0][productid]); }

Tested with 3.5.10 (may work with 4.0.x)
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #6  
Old 08-13-2004, 11:39 AM
 
rgbdna rgbdna is offline
 

Advanced Member
  
Join Date: Jul 2004
Posts: 31
 

Default Sweeet!

Sweeet! It works great!

I am going to donate to you via Paypal right now!

Thanks!

rgbdna
__________________
v.3.10.5 Great creative direction is clarity cleverly delivered.
Reply With Quote
  #7  
Old 10-30-2004, 08:00 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

sadly, this nice mod conflicts with the html catalog.

Example:

If you created a category called "Exclusive" and only put one item in it, say "Space Cowboy Knife". When the user clicks on the category, "exclusive", this mod takes them to "Space Cowboy Knife" if the user is in *php mode.

If the user is browsing the html catalog, clicking on the exclusive category will just lead them to a blank page.

Can someone else confirm this or am I a dumbass?
Reply With Quote
  #8  
Old 10-30-2004, 08:12 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Maybe you could have the products.php code issue a unique value if productcount = 1.

Then use that unique value in the tpl to trigger a redirect.

Just a suggestion. It may help if you category page is generated with SOME code in it.

By the way, I can confirm that you are not a dumbass.
Reply With Quote
  #9  
Old 10-31-2004, 10:33 AM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

thanks for the suggestions adp. But I have no php knowledge at all. ;( What would be the code to redirect if the user is in the HTML catalog?

thanks

-Version 3.5.11
Reply With Quote
  #10  
Old 10-31-2004, 10:40 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Dunno. I'm not a PHP guy.

That was just a suggestion of how you could put the switch in the tpl. That way the catalog would generate a category page that redirected to the product page. Hiding all of the code in PHP is not giving the catalog a chance to generate the category page.

You gotta bug someone smart to help you implement this. It's outta my field.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


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 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 12:01 PM.

   

 
X-Cart forums © 2001-2020