| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Smarty - Browser Identifier? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Smarty - Browser Identifier?
Wondering if anyone has successfully used something like this to deliver stylesheets/images/etc specifically to a certain browser?
{if $config.Adaptives.browser eq "Safari"} Essentially I'm looking for something that will serve up a different stylesheet for mobile devices (iphone, blackberry, etc). Any info appreciated!
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Smarty - Browser Identifier?
don't want to use javascript?
__________________
xcart 5.1.2 |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: Smarty - Browser Identifier?
You can look at this thread, while not the same, I think it is related. Start at post #6
During the discussion - I remember Jeremy and I were looking at each others sites where the smarty browser information was being displayed - and the results were not dependable. We did not figure out why at the time, and I believe he pursued the javascript route. You may want to test printing the browser variable first and see if it works consistently. As I remember - sometimes we had to reload the page to get the smarty variable to identify the browser?
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#4
|
|||||||
|
|||||||
Re: Smarty - Browser Identifier?
That's what I was afraid of. No, don't want to mess with JS as I just wanted some simple if statements for graphics, stylesheets, etc. Too bad, Smarty would have made this SO easy.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||||
|
|||||||||
Re: Smarty - Browser Identifier?
I hope I did not discourage you too much. It seems like the smarty variables should work on any page that calls browser_identificator.js - but not all pages do, and we never went too far in trying to figure out how XCART is doing this. If you are only concerned about the home page - I think you may be okay because that is where xcart identifies the browser and puts the info into the smarty, the db and session variables, and, I believe cookie.
Why we decided it was unstable was - it appeared that if you already had a session going from another cart it would not set the smarty variables. You could clear the cookie from the site, go back to the home page, and it would fill the smarty variables again. On subsequent versions of X-CART - I thought they cleaned up their cookie process - so it may be okay on recent versions? It may be worth trying it out.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
|
|||
X-Cart forums © 2001-2020
|