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

root cat

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 10-29-2009, 05:19 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: root cat

Ashley, I've tried using the root category in my products.tpl and with our flyout categories mod, but no cigar. I ended up creating other templates to get the result that I wanted, but it was far more work. If you find an answer for capturing the root category, please post it.
__________________
______________
version 4.1.9 Gold
Reply With Quote
  #12  
Old 11-25-2009, 05:33 AM
  TBone's Avatar 
TBone TBone is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 38
 

Default Re: root cat

Try this:

{$current_category.categoryid_path|regex_replace:" /\/[0-9\/]*/":""}

this fetches the root category from the path. It finds the first "/" and replaces everything after it with nothing leaving the current root cat id.

Hope this helps.
__________________
_____________________________________________
www.webcreatives.nl | X-Cart Shops
X-Cart Versions 4.1.x | 4.2.x | 4.3.x | 4.4.x
Parallelweg 124-14, 1948 NN BEVERWIJK
The Netherlands
Reply With Quote
  #13  
Old 11-27-2009, 07:38 PM
 
hollaratbear hollaratbear is offline
 

Advanced Member
  
Join Date: Nov 2009
Posts: 37
 

Default Re: root cat

Has anybody gotten any of these to work? I've been looking to implement this as well. I tried a few suggestions here but no dice......
__________________
hollaratbear
Xcart Gold 4.2.1 Newbie
Reply With Quote
  #14  
Old 11-27-2009, 07:50 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: root cat

nope never got it to work.
__________________
xcart 5.1.2
Reply With Quote
  #15  
Old 01-22-2010, 08:18 AM
  Jon's Avatar 
Jon Jon is offline
 

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

Default Re: root cat

I always like keeping processing in php when possible.

Open home.php

FIND:

Code:
require $xcart_dir."/include/categories.php";

AFTER ADD:

Code:
// WCM - Get Root Cat (customization) $wcmRootCat = func_query_first("SELECT categoryid,category FROM $sql_tbl[categories] WHERE categoryid='" . (int)current(explode('/',($current_category['categoryid_path']))) . "'"); $current_category['root_categoryid'] = $wcmRootCat['categoryid']; $current_category['root_category'] = $wcmRootCat['category']; $smarty->assign('current_category',$current_category); // / WCM - Get Root Cat (customization)

In your template use:

Code:
{if $current_category.root_categoryid eq X} The root category for this is: {$current_category.root_category}. {else} Something else {/if}
Reply With Quote
  #16  
Old 01-22-2010, 08:27 AM
  Jon's Avatar 
Jon Jon is offline
 

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

Default Re: root cat

Just reviewed the reason behind needing this and our Category Map module be be a solution: http://www.websitecm.com/x-cart-mods/x-cart-seo-category-map.html
Reply With Quote
  #17  
Old 01-23-2010, 12:45 PM
 
Duramax 6.6L Duramax 6.6L is offline
 

X-Adept
  
Join Date: Dec 2006
Posts: 865
 

Default Re: root cat

Could someone please explain in detail why this is so important.
__________________
Xcart 5.1.6 Building New Store
Xcart4.6.4 Gold Plus
Xcart 4.6.4 Platinum
Smart Template,
Mail Chimp Upgrade
Checkout One (One Page Checkout)
Checkout One X-Payments Connector
Checkout One Deluxe Tools
Call For Price
On Sale Module
Buy Together Module
MAP Price MOD
Reply With Quote
  #18  
Old 01-23-2010, 06:54 PM
  Jon's Avatar 
Jon Jon is offline
 

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

Default Re: root cat

Why what in particular is so important?
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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

   

 
X-Cart forums © 2001-2020