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

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

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-16-2010, 01:09 PM
 
Marc Washburn Marc Washburn is offline
 

Advanced Member
  
Join Date: May 2004
Posts: 72
 

Default 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>
__________________
Marc Washburn
Natural Bath & Body Shop
P.O. Box 2555
Tarpon Springs, FL 34688
marc@naturalbathandbodyshop.com
www.naturalbathandbodyshop.com

Mod Newbie
X-cart 4.4.5 - Now Live !!! Hurray!
X-cart 4.2.1 - Delicae Gourmet
Reply With Quote
  #2  
Old 03-16-2010, 02:45 PM
  gizmo's Avatar 
gizmo gizmo is offline
 

X-Adept
  
Join Date: Jan 2005
Location: Crawley : UK
Posts: 618
 

Default 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
__________________
Thank You - Alan
Don't be like me, and keep saying "Nearly did it" go do it!!
Version: 4.4.4 Gold -
Reply With Quote
  #3  
Old 03-16-2010, 02:48 PM
  gizmo's Avatar 
gizmo gizmo is offline
 

X-Adept
  
Join Date: Jan 2005
Location: Crawley : UK
Posts: 618
 

Default 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:
__________________
Thank You - Alan
Don't be like me, and keep saying "Nearly did it" go do it!!
Version: 4.4.4 Gold -
Reply With Quote
  #4  
Old 03-16-2010, 03:50 PM
 
Marc Washburn Marc Washburn is offline
 

Advanced Member
  
Join Date: May 2004
Posts: 72
 

Default 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.
__________________
Marc Washburn
Natural Bath & Body Shop
P.O. Box 2555
Tarpon Springs, FL 34688
marc@naturalbathandbodyshop.com
www.naturalbathandbodyshop.com

Mod Newbie
X-cart 4.4.5 - Now Live !!! Hurray!
X-cart 4.2.1 - Delicae Gourmet
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 05:13 PM.

   

 
X-Cart forums © 2001-2020