| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Load different style sheets for main categories | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I need to change the style sheet and store logo based on different main categories.
I am using the latest Version 4.5.0 I need the new style sheet to persist in all sub categories and products. I know it can probably be done with an if...else block but need help. Thanks
__________________
Version 4.5.2 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Not an easy request unfortunately. I am thinking about how this might be accomplished...
It is easy to write an if statement for the category page itself in smarty: PHP Code:
Getting it to stick on all the sub cats and products is going to be the tough part. You will have to write some php code that looks at the entire category structure, then determines which main category this particular product or category is in. Certainly not impossible, but a little daunting.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#3
|
|||||||
|
|||||||
![]() What if i had a comma separated list of cat IDs.
If $catid IN '22,23,25,35" ......... Where would I put this if statement, in which file? many thanks
__________________
Version 4.5.2 |
|||||||
#4
|
|||||||||
|
|||||||||
![]() I have done this for a client. You need to get your main cats assigned to smarty at all times with the one being used assigned as well so you can base the css file load on it. Then in templates you just use an if statement which css file to load. It has to be done in php
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#5
|
|||||||
|
|||||||
![]() Thanks. I don't fully understand what you mean by 'cats assigned to smarty at all times'.
Appreciate your help here. Thanks
__________________
Version 4.5.2 |
|||||||
#6
|
|||||||||
|
|||||||||
![]() Your php code have to pick the main categories you want to use and assign them to smarty on each and every page, as well as specifically point out which one is to be used.
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#7
|
|||||||
|
|||||||
![]() Sorry still don't understand.
Is this something you could do for me? Thanks
__________________
Version 4.5.2 |
|||||||
#8
|
|||||||||
|
|||||||||
![]() Yes I can code this for you. Email me with details what exactly is needed
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#9
|
|||||||
|
|||||||
![]() Had an idea!
With clean URLs set the URL can/will contain the category name? What smarty or PHP code would look for a word inside the URL and load image/css based on what it finds eg. {if strpos($smarty.get.page, "SWCHS.html") !== false} <p>SWCHS image/CSS</p> {else} default image/css {/if} Would something like that work? If so what code should I use as my example is not finding SWCHS Keith
__________________
tech990 |
|||||||
#10
|
|||||||||
|
|||||||||
![]() Have you tested by simply putting {$smarty.get.page} and seeing what the results are? I believe that variable shows the result of _get requests.
Try {$smarty.server.REQUEST_URI}: PHP Code:
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|