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

Product.tpl need to know root cat

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-26-2004, 03:46 PM
  ETInteractive.com's Avatar 
ETInteractive.com ETInteractive.com is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 747
 

Default Product.tpl need to know root cat

How can i determine the ROOT category of the product i am currently on.

Basically im looking ot see if the product's root cat is "Apparel" then if it is, i want to include a Sizing Chart link for customers.

but lets say its, "Motherboards" then dont show the sizing chart link.

Any ideas?

TIA,
Tony
__________________
ETInteractive.com
X-Cart 3.5.x
Reply With Quote
  #2  
Old 10-27-2004, 04:09 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

look at how the location variable works

something like

Code:
{if $location[1].0 eq "Apparel"} blah blah {if}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 10-27-2004, 05:16 AM
  ETInteractive.com's Avatar 
ETInteractive.com ETInteractive.com is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 747
 

Default

where can i find more info on Location var?

searching around, no luck.

Thanks Shan!
__________________
ETInteractive.com
X-Cart 3.5.x
Reply With Quote
  #4  
Old 10-27-2004, 05:21 AM
  ETInteractive.com's Avatar 
ETInteractive.com ETInteractive.com is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 747
 

Default

Found it

{$location[position].1} is the variable.
__________________
ETInteractive.com
X-Cart 3.5.x
Reply With Quote
  #5  
Old 10-27-2004, 05:46 AM
  ETInteractive.com's Avatar 
ETInteractive.com ETInteractive.com is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 747
 

Default

Problem.

if i use this code
Code:
{if {$location[position].1} eq "Riding Gear"} [img]{$ImagesDir}/size_icon.gif[/img] {/if}

I get the following output:

eq "Riding Gear"} Image appears



if i use this code
Code:
{if $location[position].1 eq "Riding Gear"} [img]{$ImagesDir}/size_icon.gif[/img] {/if}


I get NOTHING to output.

what am i doing wrong?
__________________
ETInteractive.com
X-Cart 3.5.x
Reply With Quote
  #6  
Old 10-27-2004, 06:09 AM
  ETInteractive.com's Avatar 
ETInteractive.com ETInteractive.com is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 747
 

Default

{if $location[0].0 eq "Gear"}
blah blha
{/if}

This works, thanks Shan.
__________________
ETInteractive.com
X-Cart 3.5.x
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 02:22 PM.

   

 
X-Cart forums © 2001-2020