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)
-   -   Automatic Kayako SupportWorks / eSupport Login (https://forum.x-cart.com/showthread.php?t=19645)

craigbrass 02-01-2006 12:00 AM

Automatic Kayako SupportWorks / eSupport Login
 
Hello,

Having seen how AWBS automatically logs you into Kayako when you click the "Support System" link, I thought "Why couldn't X-Cart have such an intergration". So, I developed one. To intergrate it, do the following :-

1. Install Kayako SupportWorks / eSupport.
2. Setup the LoginShare correctly by entering the database details and also setting the main template group to use the X-Cart login routine.
3. Open up ./auth.php inside your X-Cart installation and enter the following code at the VERY bottom just before the "?>" :-
Code:

// ------------------------------------------------------
// ---------------- Kayako Passover ---------------------
// ------------------------------------------------------

$kayako_URL = ""; // This should be the full URL to your Kayako installtion including index.php. For example http://www.itselixir.com/helpdesk/index.php

$kayako_passover_user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE login='$login' AND usertype='C' AND status='Y'");

$kayako_passover_user_password = text_decrypt($kayako_passover_user_data["password"]);

$smarty->assign("kayako_passover_user_password", $kayako_passover_user_password);
$smarty->assign("kayako_URL", $kayako_URL);

// ------------------------------------------------------
// --------------- End Kayako Passover ------------------
// ------------------------------------------------------


4. Set the $kayako_URL in the above code.
5. Open ./skin1/authbox.tpl and enter the following code just after "{capture name=menu}" at the top of the file :-
Code:

{*** Kayako Passover **}
<form method="post" action="{$kayako_URL}" name="kayako_login" target="_blank">
                <input type="hidden" name="loginemail" value="{$login}">
                <input type="hidden" name="loginpassword" value="{$kayako_passover_user_password}">
                <input type="hidden" name="_m" value="core">
                <input type="hidden" name="_a" value="login">
</form>
<TABLE border="0" cellpadding="5" cellspacing="0" width="100%">
<FORM action="{$xcart_web_dir}/include/login.php" method="post" name="loginform">
{*** End Kayako Passover **}


6. Still in auth.tpl, find "{$lng.lbl_orders_history}
" and just below add :-
Code:

{*** Kayako Passover **}
Support System


{*** End Kayako Passover **}


Anyway, enjoy! If you have any problems, just post them below and I will try to help you out.

Best Regards,
Craig Brass

craigbrass 02-01-2006 12:12 AM

Oh, forgot to mention, if you want it to open in a new window when a user clicks "Support System", leave it as it is. If you want it to open in the same window, remove " target="_blank"" from the <form> in step 5.

Jon 02-01-2006 12:17 AM

Hi Craig, interesting bumping into you in a thread here after meeting in the thread to request x-cart integration on the Kayako forums ;)

I integrated my support suite with my x-cart to use the same login and password, but found it annoying that a user logged into x-cart, would have to re-enter their login/pass to access Kayako, as a result I created a script to auto-log them in.

In my Kayako support directory I put this in an .htaccess file:

Code:

DirectoryIndex home.php index.php

This allows home.php to be called prior to the kayako index.

Then in home.php I entered the following which checks for a logged in x-cart user, and if they are logged into x-cart, it will create a login form for kayako and auto-submit it using javascript, logging them automatically into kayako.

It works very similar to yours, just a bit of another integration option.

NOTE: You'll have to edit the path to skin1.css and I'd put a logo on the page or something also.

Code:

<?php

require "../auth.php";

if ($login) {

        $pass = func_query_first("SELECT password FROM $sql_tbl[customers] WHERE login='$login' LIMIT 1");
        $pass = $pass[password];
        $pass = text_decrypt($pass);

?>

        <HTML><title>Logging into Client Support Center</title>
        <link rel="stylesheet" href="/skin1/skin1.css">

        <BODY onLoad="document.loginform.submit();">

        <form name="loginform" action="index.php" method="POST">
        <input type="hidden" name="loginemail" value="<?= $login; ?>">
        <input type="hidden" name="loginpassword" value="<?= $pass; ?>"></td>
        <input type="hidden" name="rememberme" value="1">
        <input type="hidden" name="_m" value="core">
        <input type="hidden" name="_a" value="login">
        <input type="hidden" name="querystring" value="">

        <table width="100%" height="100%" ><tr><td align="center" valign="middle">
        <div align=center>
        <table cellpadding=15 cellspacing=0 width=500 bgcolor="#FFFFFF"><tr><td>
       

<font face="arial" size="3">Client Support Center</font></p>
       

<font face="arial" size="2">Please wait while we log you into the Client Support Center...</font></p>
       
<p align=center><input type="submit" class="form" value="Click here if you're not automatically logged in"></p>
        </td></tr></table>
        </div>
        </td></tr></table>
        </form></body></html>

<?
}
else {
        header("Location: index.php");
}

?>


craigbrass 02-01-2006 12:32 AM

Hi John,

Either way works really but I like to avoid messing around with .htaccess files tbh, had nothing but problems with them! :evil:

Best Regards,
Craig Brass

junaid 03-07-2006 12:23 AM

Hi Craig,
i tried to do what you had mentioned but couldnt find xcart module in Template > login share section.

do i need to do with oscommerce module , please help.
regards
Junaid

cotc2001 03-07-2006 10:24 AM

Been looking at kayako today and it certainly looks impressive.
Im a little confused on which package i need to buy though as the esupport package seems to do just the ticketing but the supportsuite seems to do the whole shebang with livechat etc.

The supportsuite looks like what i would want BUT it makes no mention of the intergration modules with it.

Jon 03-07-2006 10:27 AM

The integration modules come with the ticket system and the ticket system comes with support suite :)

cotc2001 03-07-2006 10:38 AM

Cool looks like i'll be buying that tomorrow then :D

It will be nice to have some structure on customer requests etc. - at the moment its me and a notepad to remind me to email someone when a new product comes in.

Jon 03-07-2006 10:47 AM

It has been an absolute life saver for me. I was hesitant at first because I didn't know how much it would help, but now I couldn't picture business without it.

Jon 03-07-2006 10:47 AM

Also we have some setup/installation FAQ's on our site that may help you as their documentation is severely lacking.


All times are GMT -8. The time now is 04:12 AM.

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