Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Smarty - Browser Identifier?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-03-2010, 05:36 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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
Reply With Quote
  #2  
Old 02-03-2010, 05:59 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Smarty - Browser Identifier?

don't want to use javascript?
__________________
xcart 5.1.2
Reply With Quote
  #3  
Old 02-03-2010, 07:22 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default 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)
Reply With Quote
  #4  
Old 02-04-2010, 04:25 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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
Reply With Quote
  #5  
Old 02-04-2010, 06:42 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default 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)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:35 PM.

   

 
X-Cart forums © 2001-2020