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

if/then statement based on http vs https?

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

Advanced Member
  
Join Date: Dec 2006
Posts: 47
 

Default if/then statement based on http vs https?

Is it possible to use an if/then statement depending on if you are on an https page versus an http page? If so, what is $variable for that?

Why I'm asking... My site uses "top sites" banners on the pages and those banner images do not pull from https/secure sites. The rest of the store area is on a secure server and so, when a customer registers/logs in, they switch from browsing http pages to the https pages and keep getting that annoying "This page contains both secure and non-secure items." I'd like to have the banners displayed when on http and turned off when on https pages.
__________________
currently: 4.7.1

previously: XCart Version 4.4.5 Pro
Reply With Quote
  #2  
Old 02-14-2007, 09:50 AM
 
balinor balinor is offline
 

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

Default Re: if/then statement based on http vs https?

{if $smarty.server.HTTPS eq "on"}

content for secure page

{else}

content for insecure page

{/if}
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote

The following user thanks balinor for this useful post:
Ben G (07-30-2014)
  #3  
Old 02-17-2007, 08:00 AM
 
vickis vickis is offline
 

Advanced Member
  
Join Date: Dec 2006
Posts: 47
 

Default Re: if/then statement based on http vs https?

Worked perfectly! Thanks ever so much!!!!
__________________
currently: 4.7.1

previously: XCart Version 4.4.5 Pro
Reply With Quote
  #4  
Old 11-19-2007, 12:36 AM
 
sunset sunset is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 94
 

Default Re: if/then statement based on http vs https?

Sorry if i am asking a dumb question, but i am in the same situation as vickis.

Where abouts do i place the above code?
__________________
Sunset
X-Cart Gold v4.1.8
Reply With Quote
  #5  
Old 11-19-2007, 05:12 AM
 
balinor balinor is offline
 

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

Default Re: if/then statement based on http vs https?

It is meant to be used to show one thing if the page is secure, and one if not secure, so you would place it wherever you want those items to show.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 11-19-2007, 05:25 AM
 
sunset sunset is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 94
 

Default Re: if/then statement based on http vs https?

Thanks very much Balinor
__________________
Sunset
X-Cart Gold v4.1.8
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:51 AM.

   

 
X-Cart forums © 2001-2020