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 excluding an item from https pages (https://forum.x-cart.com/showthread.php?t=27189)

HWT 12-07-2006 10:46 AM

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

mrkenzie 12-07-2006 03:00 PM

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?

HWT 12-07-2006 05:32 PM

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>



HWT 12-07-2006 05:41 PM

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. :lol:

Jon 12-08-2006 05:50 PM

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}


just_me 01-04-2007 08:51 AM

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!


All times are GMT -8. The time now is 06:05 AM.

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