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
  #11  
Old 07-31-2006, 08:34 AM
  moneysaver67's Avatar 
moneysaver67 moneysaver67 is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 74
 

Default

Quote:
Originally Posted by darrenkierman
One small bug .... lets say you have one product and 5 subcategories, it will not show the subcategories because it automatically jumps to the one product. To fix it :

Code:
{if $products|@count eq 1} {if $subcategories}{else} {assign var="prodURL" value="product.php?productid=`$products.0.productid`&cat=$cat&page=1"} {php} header( "Location: " . $GLOBALS[smarty]->_tpl_vars[prodURL] ); {/php} {/if} {/if}

@darren, good find.

@carpeperdiem, good point.

I think the key here is to realize that different shops are obviously set up to operate and navigate in different manners. Per darren's piont, I can understand having a top-level category with three sub-cats, but wanting the users to see the subcats before being taken to the product page. In this case, I would modify the code so that drilling into the subcat itself would take you to the product page?

Either way, good posts on use of the code. I also enjoy the search result hook. Keep 'em coming!
__________________
X-Cart 4.0.16-.19 Gold [unix] / DSEFU
Reply With Quote
  #12  
Old 08-05-2006, 07:21 AM
 
ecommerce ecommerce is offline
 

eXpert
  
Join Date: Jul 2006
Posts: 267
 

Default

"Rock on" ! LOL moneysaver, i hadnt heard that since wayne's world! LOLOLOLOL

good mod by the way.

and i do think that if the category has 1 procut and subcategories,

then it should present the subs adn the procuct. NOT go to the product directly. If you go to the product directly.

i understand carpes point, but he's using a 3 level flyout, so his mindset is a little different. Others are just using the default xcart menu.
__________________
X-Cart 4.0.18 DBest
Reply With Quote
  #13  
Old 09-19-2006, 06:47 AM
 
Acquamarina Acquamarina is offline
 

X-Adept
  
Join Date: Aug 2006
Location: USA
Posts: 811
 

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

Carperdiem,

I just visited the Mommymakeup.com site and it looks great! I a, wondering if you used a mod for Debbie's favorites and would you mind sharing which one? I would like to do that on my site. Thanks!

Vera
__________________
Vera B
4.4.5
CFLSystems.com mods, Kosmos eBay Integration, Feed Manager Pro, custom mods, BCSEngineering Mods, CDSEO PRO
Hosting by EWDHosting - The best home for your x-cart.
Reply With Quote
  #14  
Old 09-19-2006, 07:33 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 Acquamarina
Carperdiem,

I just visited the Mommymakeup.com site and it looks great! I a, wondering if you used a mod for Debbie's favorites and would you mind sharing which one? I would like to do that on my site. Thanks!

Vera

Here ya go...

http://forum.x-cart.com/showthread.php?t=24671
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #15  
Old 09-19-2006, 09:15 AM
 
Acquamarina Acquamarina is offline
 

X-Adept
  
Join Date: Aug 2006
Location: USA
Posts: 811
 

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

Thanks!

Vera
__________________
Vera B
4.4.5
CFLSystems.com mods, Kosmos eBay Integration, Feed Manager Pro, custom mods, BCSEngineering Mods, CDSEO PRO
Hosting by EWDHosting - The best home for your x-cart.
Reply With Quote
  #16  
Old 09-19-2006, 01:34 PM
  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

Just a note, if your using CDSEO then:

Replace:

Code:
{assign var="prodURL" value="product.php?productid=`$products.0.productid`&cat=$cat&page=1"}

with:

Code:
{assign var="prodURL" value="`$http_location`/`$cdseo_prod`/`$products.0.cdseo_url`"}
Reply With Quote
  #17  
Old 12-01-2006, 04:18 PM
 
ryan c. ryan c. is offline
 

Advanced Member
  
Join Date: Sep 2002
Posts: 58
 

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

works great!
__________________
Version 4.1.8
Reply With Quote
  #18  
Old 12-01-2006, 07:42 PM
 
gastu gastu is offline
 

Senior Member
  
Join Date: Oct 2005
Location: Chile
Posts: 105
 

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

and when have only one product in manufacter?
__________________
Gonzalo Astudillo Pizarro | https://about.me/gonzaloastudillo
Reply With Quote
  #19  
Old 12-18-2006, 09:47 AM
 
jeanne jeanne is offline
 

Advanced Member
  
Join Date: Aug 2004
Posts: 85
 

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

Does anyone have it working with the SAFETYNET DSEFU MOD?

Jeanne
Gold 4.0.17
Reply With Quote
  #20  
Old 10-10-2007, 06:21 AM
 
alreadyregistered alreadyregistered is offline
 

Member
  
Join Date: Sep 2006
Location: Cocoa, Florida
Posts: 28
 

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

I could kiss you on the lips for this mod. Just what I needed. Merci beaucoup.



Tyme
__________________
XCart Gold 4.1.3
Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b PHP/5.0.3 mod_perl/1.27
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 10:54 AM.

   

 
X-Cart forums © 2001-2020