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

IF Statement for HTTPS/HTTP

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-02-2007, 06:09 AM
 
robidigital robidigital is offline
 

Member
  
Join Date: Aug 2004
Posts: 23
 

Default 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}
__________________
Ryan Robillard
www.RobiDigital.com
Hagerstown, Boonsboro, Frederick, MD web site design, development and graphic design

X-Cart v4.4.2 Gold
Reply With Quote
  #2  
Old 05-02-2007, 06:16 AM
 
stevekem stevekem is offline
 

Senior Member
  
Join Date: Dec 2006
Posts: 111
 

Default 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}
__________________
X-Cart Gold v4.4.1
Reply With Quote
  #3  
Old 05-02-2007, 06:16 AM
 
hooter hooter is offline
 

X-Adept
  
Join Date: Dec 2004
Posts: 519
 

Default 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}
__________________
Blog for X-Cart | Ebay Auction Manager
Reply With Quote
  #4  
Old 05-02-2007, 06:59 AM
 
robidigital robidigital is offline
 

Member
  
Join Date: Aug 2004
Posts: 23
 

Default Re: IF Statement for HTTPS/HTTP

Thanks a lot! It works perfect!
__________________
Ryan Robillard
www.RobiDigital.com
Hagerstown, Boonsboro, Frederick, MD web site design, development and graphic design

X-Cart v4.4.2 Gold
Reply With Quote
  #5  
Old 05-17-2007, 08:39 AM
 
Ben G Ben G is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 100
 

Question 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}
__________________
Ben
X-Cart 4.6.6 Gold Plus - lots of modules
X-Cart 4.7.9 Gold Plus - lots of modules
Reply With Quote
  #6  
Old 05-17-2007, 09:52 AM
 
balinor balinor is offline
 

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

Default 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
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #7  
Old 05-17-2007, 04:11 PM
 
Ben G Ben G is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 100
 

Default 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:}
__________________
Ben
X-Cart 4.6.6 Gold Plus - lots of modules
X-Cart 4.7.9 Gold Plus - lots of modules
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 10:55 AM.

   

 
X-Cart forums © 2001-2020