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

find category id and parent cat id

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-17-2014, 05:27 AM
 
IFO IFO is offline
 

Member
  
Join Date: Nov 2013
Posts: 24
 

Default find category id and parent cat id

I want to add/remove stuff on the product detail page based on the category id

so I have

{if ($current_category.categoryid != 23) } do this

But it's not working

I really need to do this for cat 23 and all it's children. Is there a way to say if "parent category is 23) do this ?

This way client can add more subcats w/o having to change code.

thanks

DonnaNJ
XC4.5
__________________
Version 4.6.1 + Mobile 1.4.1
Reply With Quote
  #2  
Old 04-17-2014, 06:45 AM
 
IFO IFO is offline
 

Member
  
Join Date: Nov 2013
Posts: 24
 

Default Re: find category id and parent cat id

This works for the prod category

But I'd still like to do it for a cat and all the childres

{if $product.categoryid != 23 }
__________________
Version 4.6.1 + Mobile 1.4.1
Reply With Quote
  #3  
Old 04-17-2014, 04:47 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: find category id and parent cat id

Does this thread help?
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #4  
Old 04-18-2014, 01:54 PM
 
IFO IFO is offline
 

Member
  
Join Date: Nov 2013
Posts: 24
 

Default Re: find category id and parent cat id

I tried to add the code
{assign var=myCats value=","|explode:"22,23,25,35"}
{if
in_array($catid, $myCats)}

but it completely breaks the template ?

Am I missing something ?
__________________
Version 4.6.1 + Mobile 1.4.1
Reply With Quote
  #5  
Old 04-18-2014, 02:10 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: find category id and parent cat id

I'm guessing the error has to do with not liking "explode". This explains that situation. I add something like this to the end of postauth.php:
PHP Code:
array_push($smarty->security_settings['MODIFIER_FUNCS'], 'explode'); 
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
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 03:06 PM.

   

 
X-Cart forums © 2001-2020