Detect HTTPS mode in Smarty

Category: X-Cart Snippets
Added:
Enter Price $
SKU SKU82
Quantity

If you get a security alert when in secure mode, it's usually due to offsite elements such as SSL certificate seals, images and javascript that are not secure, in which case you can fix with this code...

Examples...

{if $smarty.server.HTTPS eq "1"}Secure{else}Not secure{/if}
{if $smarty.server.HTTPS eq "1"}{$https_location}{else}{$http_location}{/if}
<img src="http{if $smarty.server.HTTPS eq '1'}s{/if}://www.geotrust.com/seal.gif" />
The website uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy.
More Information