X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   find category id and parent cat id (https://forum.x-cart.com/showthread.php?t=69037)

IFO 04-17-2014 05:27 AM

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

IFO 04-17-2014 06:45 AM

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 }

cherie 04-17-2014 04:47 PM

Re: find category id and parent cat id
 
Does this thread help?

IFO 04-18-2014 01:54 PM

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 ?

cherie 04-18-2014 02:10 PM

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'); 



All times are GMT -8. The time now is 08:19 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.