hello,
I've been working on this Xcart for two weeks and I've managed to write a complete custom theme...
But now my client wishes to have a different stylesheet depending on which "categorie" the client is in... (so home.cat + sub.cat)... I'd like someone to follow my "train of Thought" and possibly tell me where I'm going wrong....
1st. I've created styleswitch.php in "xcart_dir/modules/styleswitch/"...
this is what is contains
PHP Code:
if ( !defined('XCART_SESSION_START') ) { header("Location: ../"); die("Access denied"); }
$sql = func_query("SELECT DISTINCT parentid FROM xcart_categories WHERE categoryid='{$cat}' LIMIT 1");
print_r($sql);
$res= mysql_query($sql) or die(mysql_error());
echo $sql; print_r($row);
while($row=mysql_fetch_assoc($res)) )
{
switch ($row["parentid"]) {
case "15":
$StyleSwitch= '<style type="text/css">body {background-image: url(images/lolalayout/bg-15.gif);}
.background { background-image: url(images/lolalayout/15.gif);}</style>';
$smarty->assign("StyleSwitch", $StyleSwitch);
break;
case "5":
$StyleSwitch= '<style type="text/css">body {background-image: url(images/lolalayout/bg-5.gif);}
.background { background: #000000;}</style>';
$smarty->assign("StyleSwitch", $StyleSwitch);
break;
}
}
?>
then I created StyleSwitch.tpl in "xcart_dir/skin1/modules/styleswitch/"...
Code:
{* $Id: StyleSwitch.tpl,v 1.8.2.1 2006/11/16 13:12:29 max Exp $ *}
{if $StyleSwitch}
{include file="{$xcart_dir}/modules/StyleSwitch/styleswitch.php"}
{/if}
finally in "home.tpl" i call up the "files".... I suppose.
Code:
{include file="{$SkinDir}/modules/StyleSwitch/StyleSwitch.tpl" }
also i "home.php" i put
Code:
if ($active_modules["StyleSwitch"])
include $xcart_dir."/modules/StyleSwitch/styleswitch.php";
but nothing seems to be working.... could a php/smarty/xcart pro have a look at this for me please????
