| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
StyleSwitch "mod" - running into some issues. | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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:
then I created StyleSwitch.tpl in "xcart_dir/skin1/modules/styleswitch/"... Code:
finally in "home.tpl" i call up the "files".... I suppose. Code:
also i "home.php" i put Code:
but nothing seems to be working.... could a php/smarty/xcart pro have a look at this for me please???? ![]()
__________________
x-cart version: 4.1.9 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Hi,
Welcome to the X-Cart community! There's a 3rd party mod that seems to be doing what you want to achieve: http://www.bcsengineering.com/store/customer/product.php?productid=159&cat=0&page=3 Also, please update your forum signature with your exact X-Cart version in order to get specified answers for your version.
__________________
____________________________ X-Cart Gold 4.1.10 EWD Hosting | CDSEO Pro | One Page Checkout | Smart Search | Telafirma Dynamic Images | X-AOM | Product Importer Pro and many custom mods and tweaks found here... |
|||||||||
#3
|
|||||||
|
|||||||
![]() i did have a look at the "product" but my boss came to the conclusion he doesn't want to charge our client with what is supposed to be a simple "mod"....
Basically all i'd need to do is load a different css file dependant on what ParentCategorie is loaded... no more no less. So I'm stuck with the questions ![]()
__________________
x-cart version: 4.1.9 |
|||||||
#4
|
|||||||
|
|||||||
![]() First, to be able to use the $active_modules variable, you have to have an entry in the xcart_modules table for your module. Also, you need to stay consistent with naming of the module directories, styleswitch vs StyleSwitch (and it needs to match your entry into xcart_modules).
Just a note, you don't *need* to configure this as a module, imho, as you could just set it up as a straight include, but that's up to you. Second, you're trying to include a PHP file in Smarty, which you cannot do (it won't work properly), at least using the method that you're using (this is the proper method), but even then, you don't need to include that php file from smarty, as you already have it included from home.php, and the file has already created a variable for use with smarty. Sooooo... modules/StyleSwitch/styleswitch.php: PHP Code:
home.php (before line: func_display("customer/home.tpl",$smarty);): PHP Code:
home.tpl (before line: </head>): Code:
NOTE: I haven't tested this yet, but should point you in the right direction... |
|||||||
#5
|
|||||||
|
|||||||
![]() I'm putting this into action and testing it... thanks for the "kick in the right direction"
![]()
__________________
x-cart version: 4.1.9 |
|||||||
#6
|
|||||||
|
|||||||
![]() I just checked out your site's xcart install, looks like it worked! Did you have to change anything, or did it do fine as-is?
EDIT: I just noticed 1 issue in the _get_absolute_parent function, if you haven't corrected it already, I suggest you copy that into your code. When the function calls itself again, it wasn't referring to the proper parentid variable, I fixed that in my post. |
|||||||
#7
|
|||||||
|
|||||||
![]() Quote:
hey, yes it worked "as is", so that was an amazing piece of help... i will test with the new code you have uploaded but thanks very much!
__________________
x-cart version: 4.1.9 |
|||||||
#8
|
|||||||
|
|||||||
![]() Hey, "i'm back"
![]() I've been off this project for a month and now that my client has noticed a "mistake" in the switcher... http://www.lolalola.be/xcart/home.php http://www.lolalola.be/xcart/home.php?cat=4 as you can see.... it does change the styles, according to the "parent - Id" But as soon as you choose a product in any category " http://www.lolalola.be/xcart/product.php?productid=58&cat=46&page=1" it switches back to the default green style..... now ofcourse that is not what is meant to happen.... PHP Code:
I've included the code that does work for the switch, but not 100% --> Can some please help me out... I know it is probably just one line of code, but I design, not develop ![]()
__________________
x-cart version: 4.1.9 |
|||||||
|
|||
X-Cart forums © 2001-2020
|