X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Adding Skype to your home.tpl file (https://forum.x-cart.com/showthread.php?t=20982)

ShishaPipeUK 04-06-2006 12:19 PM

Adding Skype to your home.tpl file
 
As you may be aware Skype is owned by Ebay now, and of cause has links with PayPal and in my opinion is the best FREE internet comunication system available. If for some unknown reason you do not know anything about Skype then you can find the web page at http://www.skype.com.

Anyway here is a small mod to include this in your shopcart/skin1/customer/home.tpl file.

1st of all right click this image http://www.shisha.co.uk/shopcart/skin1/images/skype.gif and save this in your shopcart/skin1/images/skype.gif

Next save the below Java code in your shopcart/skin1/skypeCheck.js

Code:

var activex = ((navigator.userAgent.indexOf('Win')  != -1) && (navigator.userAgent.indexOf('MSIE') != -1) && (parseInt(navigator.appVersion) >= 4 ));
var CantDetect = ((navigator.userAgent.indexOf('Safari')  != -1) || (navigator.userAgent.indexOf('Opera')  != -1));

function oopsPopup() {
        var windowName = "oops";
        var URLtoOpen = "http://download.skype.com/share/skypebuttons/oops/oops.html";
        var popW = 540, popH = 305;
        var scrollB = 'no';
        w = screen.availWidth;
        h = screen.availHeight;
        var leftPos = (w-popW)/2, topPos = (h-popH)/2;
        oopswindow = window.open(URLtoOpen, windowName,'width=' + popW + ',height=' + popH + ',scrollbars=' + scrollB + ',screenx=' +leftPos +',screeny=' +topPos +',top=' +topPos +',left=' +leftPos);
        return false;
}

if(typeof(detected) == "undefined" && activex) {
    document.write(
        ['<script language="VBscript">',
        'Function isSkypeInstalled()',
        'on error resume next',
        'Set oSkype = CreateObject("Skype.Detection")',
        'isSkypeInstalled = IsObject(oSkype)',
        'Set oSkype = nothing',
        'End Function',
        '</script>'].join("\n")
    );
}

function skypeCheck() {
    if(CantDetect) {
        return true;
    } else if(!activex) {
        var skypeMime = navigator.mimeTypes["application/x-skype"];
        detected = true;
        if(typeof(skypeMime) == "object") {
            return true;
        } else {
            return oopsPopup();
        }
    } else {
        if(isSkypeInstalled()) {
            detected = true;
            return true;
        }
    }
   
    detected = true;
    return oopsPopup();
}



Also save this tpl file in shopcart/skin1/skype.tpl - Please make sure you change the "shishapipe" to your Skype name at
Code:

<a href="skype:shishapipe?call">

Code:


{* $Id: skype.tpl,v 0.1 2006/04/06 FS Exp $ *}
{capture name=skype}
<table width="100%"  border="0" cellpadding="0">
  <tr>
    <td><div align="center">
      <script type="text/javascript" src="{$SkinDir}/skypeCheck.js"></script>
     
          <a href="skype:shishapipe?call">
         
          [img]{$ImagesDir}/skype.gif[/img]</a></div></td>
  </tr>
</table>
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title="Skype contact us" menu_content=$smarty.capture.skype }


Then in your shopcart/skin1/customer/home.tpl call the file skype.tpl by using this command below.

Code:

{ include file="skype.tpl" }

You can see this at http://www.shisha.co.uk/shopcart/home.php on the left hand side at the bottom :)

cotc2001 04-06-2006 12:40 PM

Has anyone got any opinions on the various skype phones?? i was looking at one of the cordless dual phones as we often use skypeout for overseas calls and although i've got my bluetooth headset setup for it i can't help thinking that i look a right div with it in my ear.

shakes 04-13-2006 12:54 AM

delete post.

shakes 04-13-2006 01:22 AM

well, i just figured out another way of doing it using skypes script, which comes with a very cool dropdown button, what do you guys think of it?

Code:


{* $Id: skype.tpl,v 0.1 2006/04/06 FS Exp $ *}
{capture name=skype}
<table width="100%"  border="0" cellpadding="0">
  <tr>
    <td><div align="center">
       
       
<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/buttons/transparent_dropdown/dropdown.js"></script>
<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<div id="skypeTransparentDrp">
<div id="skypeDropdown-transparent-head">[img]http://download.skype.com/share/skypebuttons/buttons/transparent_dropdown/call.png[/img][img]http://download.skype.com/share/skypebuttons/buttons/transparent_dropdown/down.png[/img]</div>
<div id="skypeDropdown-transparent" style="display: none;">
[img]http://download.skype.com/share/skypebuttons/buttons/transparent_dropdown/2.png[/img]
[img]http://download.skype.com/share/skypebuttons/buttons/transparent_dropdown/3.png[/img]
[img]http://download.skype.com/share/skypebuttons/buttons/transparent_dropdown/4.png[/img]
[img]http://download.skype.com/share/skypebuttons/buttons/transparent_dropdown/5.png[/img]

</div>
</div>
       

   
  </tr>
</table>
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title="Skype contact us" menu_content=$smarty.capture.skype }


Of course, replace my userid with yours

Code:

<a href="skype:yourskypeuserid?call">

Also, if you want to let customers send you files, you can add this to the bottom of the code for another drop down menu item. I didn't want it so i axed it.


this way you don't need to use the .js file.

sorry, i'm no coding expert so sorry about the mess.

see it in action: http://soloboardshop.com/shop/home.php

Dongan 04-13-2006 04:09 AM

coo. works fine. but, if SKYPE not installed, it should't be displayed.

ShishaPipeUK 04-13-2006 04:11 AM

Also does not work on a secure server, skype does not have the buttons or the script in a https (secure server) So if you do not have a secure server then fine, but you will get the message error message if you use https :(

shakes 04-13-2006 09:47 AM

Quote:

Originally Posted by ShishaPipeUK
Also does not work on a secure server, skype does not have the buttons or the script in a https (secure server) So if you do not have a secure server then fine, but you will get the message error message if you use https :(


well, i'll be getting https soon, so that's good to know. thanks.

Audiolines 11-10-2006 04:39 PM

Re: Adding Skype to your home.tpl file
 
anyone know how to not make it pop up if a user does not have skype?

ezi designs 12-02-2006 08:42 AM

Re: Adding Skype to your home.tpl file
 
Hi

In answer to your question there is an easy way to add the pop up that you are after. But first go to http://www.skype.com/share/buttons/ to get your code, then depending on you preferred location just copy & paste it in.

Mine goes something like this, in the skin1/customer/home.tpl:

<td class="VertMenuRightColumn">
{if $active_modules.SnS_connector && $config.SnS_connector.sns_display_button eq 'Y' && $sns_collector_path_url ne ''}
{include file="modules/SnS_connector/button.tpl"}
{/if}
<!--
Skype 'My status' button
http://www.skype.com/go/skypebuttons
-->
<script type="text/javascript" src="
>
<a href="skype:what ever your skype name is?call"><img src="
http://mystatus.skype.com/balloon/dlp%2Eskype" style="border: none;" width="150" height="60" alt="My status" /></a>
</p>
{if $active_modules.Feature_Comparison ne "" && $comparison_products ne ''}


Hope this helps and if the user does not have Skype they get a download pop up.


Richard :D/

sales@webosusa.com 01-24-2008 02:09 PM

Re: Adding Skype to your home.tpl file
 
Quote:

Originally Posted by ShishaPipeUK
As you may be aware Skype is owned by Ebay now, and of cause has links with PayPal and in my opinion is the best FREE internet comunication system available. If for some unknown reason you do not know anything about Skype then you can find the web page at http://www.skype.com.

Anyway here is a small mod to include this in your shopcart/skin1/customer/home.tpl file.

1st of all right click this image http://www.shisha.co.uk/shopcart/skin1/images/skype.gif and save this in your shopcart/skin1/images/skype.gif

Next save the below Java code in your shopcart/skin1/skypeCheck.js

Code:

var activex = ((navigator.userAgent.indexOf('Win')  != -1) && (navigator.userAgent.indexOf('MSIE') != -1) && (parseInt(navigator.appVersion) >= 4 ));
var CantDetect = ((navigator.userAgent.indexOf('Safari')  != -1) || (navigator.userAgent.indexOf('Opera')  != -1));

function oopsPopup() {
    var windowName = "oops";
    var URLtoOpen = "http://download.skype.com/share/skypebuttons/oops/oops.html";
    var popW = 540, popH = 305;
    var scrollB = 'no';
    w = screen.availWidth;
    h = screen.availHeight;
    var leftPos = (w-popW)/2, topPos = (h-popH)/2;
    oopswindow = window.open(URLtoOpen, windowName,'width=' + popW + ',height=' + popH + ',scrollbars=' + scrollB + ',screenx=' +leftPos +',screeny=' +topPos +',top=' +topPos +',left=' +leftPos);
    return false;
}

if(typeof(detected) == "undefined" && activex) {
    document.write(
        ['<script language="VBscript">',
        'Function isSkypeInstalled()',
        'on error resume next',
        'Set oSkype = CreateObject("Skype.Detection")',
        'isSkypeInstalled = IsObject(oSkype)',
        'Set oSkype = nothing',
        'End Function',
        '</script>'].join("\n")
    );
}

function skypeCheck() {
    if(CantDetect) {
        return true;
    } else if(!activex) {
        var skypeMime = navigator.mimeTypes["application/x-skype"];
        detected = true;
        if(typeof(skypeMime) == "object") {
            return true;
        } else {
            return oopsPopup();
        }
    } else {
        if(isSkypeInstalled()) {
            detected = true;
            return true;
        }
    }
   
    detected = true;
    return oopsPopup();
}



Also save this tpl file in shopcart/skin1/skype.tpl - Please make sure you change the "shishapipe" to your Skype name at
Code:

<a href="skype:shishapipe?call">

Code:


{* $Id: skype.tpl,v 0.1 2006/04/06 FS Exp $ *}
{capture name=skype}
<table width="100%"  border="0" cellpadding="0">
  <tr>
    <td><div align="center">
      <script type="text/javascript" src="{$SkinDir}/skypeCheck.js"></script>
     
      <a href="skype:shishapipe?call">
     
      [img]{$ImagesDir}/skype.gif[/img]</a></div></td>
  </tr>
</table>
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title="Skype contact us" menu_content=$smarty.capture.skype }


Then in your shopcart/skin1/customer/home.tpl call the file skype.tpl by using this command below.

Code:

{ include file="skype.tpl" }

You can see this at http://www.shisha.co.uk/shopcart/home.php on the left hand side at the bottom :)


Does who a funy error like if the tamplate do not reconize the image for skype. See below...

http://www.support.webosusa.com/images/mods-problems/skype-problem.jpg

Canything to be change?


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

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