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)
-   -   How to have different head.tpl for http vs https pages (https://forum.x-cart.com/showthread.php?t=52843)

Marc Washburn 03-16-2010 01:09 PM

How to have different head.tpl for http vs https pages
 
Hi,

I am using a free tracking/customer chat tool called Livezilla (www.livezilla.com).

For simplicity, I installed the 'chat' button into the head.tpl file...the problem is that the code points to a non SSL HTTP graphic and code. This means that during checkout, our customers are getting a 'this page contains unsecured elements' error which tends to freak them out.

Looking for the easiest solution to fix this.

Would it be easier to split the head.tpl into two separate files (one for http & one for https), or would it be simpler to figure out how to use javascript to replace the hard-coded path of:

<a href="javascript:void(window.open('http://www.naturalbathandbodyshop.com/livezilla/livezilla.php'

with this?

<a href="{$http_location}/">

My javascripting (I assume this is javascript) really sucks, how would you integrate that bottom snippet with the top piece?

thanks in advance, the beggining part of my head.tpl listed below...


Code:

Code:

{* $Id: head.tpl,v 1.58.2.3 2008/02/07 13:17:30 ferz Exp $ *}
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
        <td class="HeadLogo"><a href="{$http_location}/"><img src="{$ImagesDir}/xlogo.gif" width="244" height="67" alt="" /></a></td>
        <td class="HeadLogo"><!-- http://www.LiveZilla.net Chat Button Link Code --><div style="text-align:center;width:145px;"><a href="javascript:void(window.open('http://www.naturalbathandbodyshop.com/livezilla/livezilla.php','','width=600,height=550,left=0,top=0,resizable=yes,menubar=no,location=yes,status=yes,scrollbars=yes'))"><img src="http://www.naturalbathandbodyshop.com/livezilla/image.php?id=03" width="145" height="69" border="0" alt="LiveZilla Live Help"></a><noscript><div><a href="http://www.naturalbathandbodyshop.com/livezilla/livezilla.php" target="_blank">Start Live Help Chat</a></div></noscript></div><!-- http://www.LiveZilla.net Chat Button Link Code --><!-- http://www.LiveZilla.net Tracking Code --><div id="livezilla_tracking" style="display:none"></div><script language="JavaScript" type="text/javascript">
<!--
var script = document.createElement("script");script.type="text/javascript";var src = "http://www.naturalbathandbodyshop.com/livezilla/server.php?request=track&output=jscript&nse="+Math.random();setTimeout("script.src=src;document.getElementById('livezilla_tracking').appendChild(script)",1);
// -->
</script><!-- http://www.LiveZilla.net Tracking Code --></td>


gizmo 03-16-2010 02:45 PM

Re: How to have different head.tpl for http vs https pages
 
You just need to put your live chat image in your root skin directory

Image Appears here > http://www.naturalbathandbodyshop.com/livezilla/image.php?id=03

gizmo 03-16-2010 02:48 PM

Re: How to have different head.tpl for http vs https pages
 
Just to note |I don't know if you turned secured off but when I buy product and go to checkout it's still on /http:

Marc Washburn 03-16-2010 03:50 PM

Re: How to have different head.tpl for http vs https pages
 
Thanks for the reply,

I found a problem in which I had the wrong setting for:

"Do not redirect customers from HTTPS to HTTP:"

I had it checked when it should have been unchecked (isn't that option written backwards? shouldn't it be HTTP to HTTPS?"

Back to the original problem, I solved it in a lazy way, but it seems to work great.

I changed it so the code in the head.tpl file now ALWAYS loads the LiveZilla Graphic and PHP counter pages via secure HTTPS. This way there won't be a complaint during checkout.

Now of course this probably will have a slight performance impact on the other non SSL pages, but it solves the problem....hurray and thanks for the suggestion, it got my brain to start thinking.


All times are GMT -8. The time now is 06:24 PM.

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