dandumit Posted October 27, 2010 Share Posted October 27, 2010 I would like to make some changes in header.tpl depending on user's browser type and version.Is there any smarty variable that could tell me this ? I have seen that in php I can find the HTTP_USER agent - but how do I get this in a smarty template ? Link to comment Share on other sites More sharing options...
MrBaseball34 Posted October 27, 2010 Share Posted October 27, 2010 $smarty.server.HTTP_USER_AGENT is what you are looking for... Link to comment Share on other sites More sharing options...
dandumit Posted October 28, 2010 Author Share Posted October 28, 2010 Many thanks !I have found also interesting variables : http://www.sandfighter.net/prestashop/smarty-globals-in-prestashop-uncovered/ But I believe that I should get acquainted with smarty first.Taking your starting point I have found : {if "MSIE"|eregi:$smarty.server.HTTP_USER_AGENT or "Internet Explorer"|eregi:$smarty.server.HTTP_USER_AGENT} .... {/if} Link to comment Share on other sites More sharing options...
MrBaseball34 Posted October 28, 2010 Share Posted October 28, 2010 Be aware that eregi function has been DEPRECATED and should be replaced with {if "MSIE"|preg_match:\$smarty.server.HTTP_USER_AGENT\i or "Internet Explorer"|preg_match:\$smarty.server.HTTP_USER_AGENT\i}...{/if} This has not been tested, however. Link to comment Share on other sites More sharing options...
Recommended Posts