X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   IF Statement for HTTPS/HTTP (https://forum.x-cart.com/showthread.php?t=30881)

robidigital 05-02-2007 06:09 AM

IF Statement for HTTPS/HTTP
 
Does anyone know of an IF statement that I could use in my template files to display a piece of code only if the site is not in https? For example
Code:

{if $site_secure_or_not == "http://"}
<img src="http://www.othersitewithnohttps.com/graphic.gif">
{/if}


stevekem 05-02-2007 06:16 AM

Re: IF Statement for HTTPS/HTTP
 
I know in 4.1.3, you can use:

Code:

{if $smarty.server.HTTPS ne "on"}<img src="http://www.othersitewithnohttps.com/graphic.gif">{/if}


I'm not sure if it's different for your version or not.




Quote:

Originally Posted by robidigital
Does anyone know of an IF statement that I could use in my template files to display a piece of code only if the site is not in https? For example
Code:

{if $site_secure_or_not == "http://"}
<img src="http://www.othersitewithnohttps.com/graphic.gif">
{/if}



hooter 05-02-2007 06:16 AM

Re: IF Statement for HTTPS/HTTP
 
Hello,

This is what you would use:
Code:

{if $smarty.server.HTTPS ne "on"}
http code here
{else}
https code here
{/if}

Quote:

Originally Posted by robidigital
Does anyone know of an IF statement that I could use in my template files to display a piece of code only if the site is not in https? For example
Code:

{if $site_secure_or_not == "http://"}
<img src="http://www.othersitewithnohttps.com/graphic.gif">
{/if}



robidigital 05-02-2007 06:59 AM

Re: IF Statement for HTTPS/HTTP
 
Thanks a lot! It works perfect!

Ben G 05-17-2007 08:39 AM

Re: IF Statement for HTTPS/HTTP
 
I am trying to do the same thing with Litecommerce so I can stop Google Adsense from appearing in my https:/ pages. The actual "If" statement for Litecommerce is fine but I am stuck on the translation of

$smarty.server.HTTPS ne "on"

into Litecommerce. I just can't get. Appreciate any help you might be able to offer.

Quote:

Originally Posted by hooter
Hello,

This is what you would use:
Code:

{if $smarty.server.HTTPS ne "on"}
http code here
{else}
https code here
{/if}



balinor 05-17-2007 09:52 AM

Re: IF Statement for HTTPS/HTTP
 
Ben, you should really post in the Litecommerce specific forums, as most of us X-Cart guys have no idea how LC works :)

Ben G 05-17-2007 04:11 PM

Re: IF Statement for HTTPS/HTTP
 
Sorry had trouble finding it. Thought an Xcart guru might know.

Anyhow, if anyone would care to know, in Litecommerce it is :

{if:!https}Insert Google Adsense Code Here{end:}


All times are GMT -8. The time now is 05:37 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.