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

if statement for excluding an item from https pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-07-2006, 10:46 AM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default if statement for excluding an item from https pages

I dislplay the shopping.com rating gif on my site, which is hard coded (http://www.shopping.com/etc.), but dynamically generated off of their site. In other words, we have 4 1/2 check marks now, but if we get a better rating, we'll have 5 for a worse rating and we'll have 4, and the .gif will update itself. The problem is, that it's throwing a secure/nonsecure warning on the registration pages. Disableing https for the registration page is not an option.

Does anybody know the if statement to use to exclude this image from secure pages?

have tried:

{if $smarty.server.HTTPS eq "on"}
What I want to go on the secure page
{else}
What I want to go on all the rest
{/if}


No-go, unfortunately.

TIA
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #2  
Old 12-07-2006, 03:00 PM
 
mrkenzie mrkenzie is offline
 

Senior Member
  
Join Date: May 2006
Posts: 182
 

Default Re: if statement for excluding an item from https pages

Strange, I have that same code in my home.tpl file and it works fine. Do you have a link, also, what page are you trying to put the code on?
__________________
Mike Kenzie
X Cart Gold Ver. 4.1.3
X-RMA
X-AOM
X-Product Comparison
Reply With Quote
  #3  
Old 12-07-2006, 05:32 PM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default Re: if statement for excluding an item from https pages

Thanks for taking a look. The link is:

https://www.heirloomwoodentoys.com/register.php

since I use ezcheckout, which breaks the cart out of home.tpl, I don't have this issue anywhere else. Yes, a small issue, but I consider any security error on my site to be a bad thing.

All the stuff on the lower right - shopping.com rating, BBB, and Geotrust images are all called from a .tpl I made called trust.tpl, which is called in home.tpl. I was trying to make it so only the shopping.com was omitted from the https pages.

trust.tpl:

Code:
<p align="center"> {if $smarty.server.HTTPS eq "on"} {else} <a href="http://www.shopping.com/xMR-Direct 2 You~MRD-xxxxxx~S-1" > <img src="http://www.shopping.com/merchant_logo?ID=xxxxxxx" width="120" height="49" border="0"alt="Read Your Store Reviews" /></a><br> {/if} <br> <a href="http://www.bbbonline.org/cks.asp?id=xxxxxxxxxxxxxxxxxxxxx"> <img src="{$ImagesDir}/bbb.gif" width="120" height="240" border="0"></a> <br> <br> {literal} <!-- GeoTrust QuickSSL [tm] Smart Icon tag. Do not edit. --> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="//smarticon.geotrust.com/si.js"></SCRIPT> <!-- end GeoTrust Smart Icon tag --> {/literal} <br> <a href="http://www.shopping.com/xDN-Toys" ><img src="https://sc.dealtime.com/cctool/files/spacer.gif" width="1" height="1" border="0"alt="" /></a></p>
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #4  
Old 12-07-2006, 05:41 PM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default Re: if statement for excluding an item from https pages

Just tried a slightly different tack:

Code:
{if $smarty.server.HTTPS eq "on"} <p align="center"> <a href="http://www.bbbonline.org/cks.asp?id=10407307355244320"> <img src="{$ImagesDir}/bbb.gif" width="120" height="240" border="0"></a> <br> <br> {literal} <!-- GeoTrust QuickSSL [tm] Smart Icon tag. Do not edit. --> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="//smarticon.geotrust.com/si.js"></SCRIPT> <!-- end GeoTrust Smart Icon tag --> {/literal} </p> {else} <a href="http://www.shopping.com/xMR-Direct 2 You~MRD-304819~S-1" > <img src="http://www.shopping.com/merchant_logo?ID=304819" width="120" height="49" border="0"alt="Read Your Store Reviews" /></a><br> <br> <a href="http://www.bbbonline.org/cks.asp?id=10407307355244320"> <img src="{$ImagesDir}/bbb.gif" width="120" height="240" border="0"></a> <br> <br> {literal} <!-- GeoTrust QuickSSL [tm] Smart Icon tag. Do not edit. --> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="//smarticon.geotrust.com/si.js"></SCRIPT> <!-- end GeoTrust Smart Icon tag --> {/literal} <br> <a href="http://www.shopping.com/xDN-Toys" ><img src="https://sc.dealtime.com/cctool/files/spacer.gif" width="1" height="1" border="0"alt="" /></a></p> {/if}

Didn't work either. I do believe I'm going nuts.
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #5  
Old 12-08-2006, 05:50 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: if statement for excluding an item from https pages

Here's the code that should work:

Code:
{if $smarty.server.HTTPS ne "on"} Your Script Code {/if}

If it doesn't work, which it sounds like it's not, try this:

Open auth.php

At the very end, but before ?> put:

Code:
$smarty->assign("wcmServerport",$HTTP_SERVER_VARS['SERVER_PORT']);

Then in your smarty template use:

Code:
{if $wcmServerport eq "80"} Your Script Code {/if}
Reply With Quote
  #6  
Old 01-04-2007, 08:51 AM
  just_me's Avatar 
just_me just_me is offline
 

Advanced Member
  
Join Date: Oct 2005
Location: Spain
Posts: 69
 

Cool Re: if statement for excluding an item from https pages

A million thanks Jon! Your solution to use the if statement works like a charm.
I'll restate it in case anybody wonders which solution I used.

Put the following code in the template where the problem occurs.

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

Here goes the script you want left out under https

{/if}

Don't forget the {/if} !

With this I was able to remove all the affiliate links, banners etc from showing on my secure pages (cart, checkout etc), causing the pop-up warning about secure and unsecure elements. My https pages now proudly show the golden lock up top of the new IE 7 browser and opens the https page without problems.

Happy New Year!
__________________
Cordially,
Just me
X-Cart Gold
Version 4.2.3
Multilingual shop: Spanish, French and US English
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 10:22 AM.

   

 
X-Cart forums © 2001-2020