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

Automatic Kayako SupportWorks / eSupport Login

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 02-01-2006, 12:00 AM
 
craigbrass craigbrass is offline
 

Advanced Member
  
Join Date: May 2005
Location: Cumbria, UK
Posts: 80
 

Default 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
__________________
Its Elixir - www.itselixir.com
Product: X-Cart Gold
Version: 4.0.17
Status: Live

Its Elixir Wholesale - www.itselixirwholesale.com
Product: X-Cart Gold
Version: 4.0.17
Status: In Development

Real Champagne - www.realchampagne.com
Product: X-Cart Gold
Version: 4.0.17
Status: In Development
Reply With Quote
  #2  
Old 02-01-2006, 12:12 AM
 
craigbrass craigbrass is offline
 

Advanced Member
  
Join Date: May 2005
Location: Cumbria, UK
Posts: 80
 

Default

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.
__________________
Its Elixir - www.itselixir.com
Product: X-Cart Gold
Version: 4.0.17
Status: Live

Its Elixir Wholesale - www.itselixirwholesale.com
Product: X-Cart Gold
Version: 4.0.17
Status: In Development

Real Champagne - www.realchampagne.com
Product: X-Cart Gold
Version: 4.0.17
Status: In Development
Reply With Quote
  #3  
Old 02-01-2006, 12:17 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

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"); } ?>
Reply With Quote
  #4  
Old 02-01-2006, 12:32 AM
 
craigbrass craigbrass is offline
 

Advanced Member
  
Join Date: May 2005
Location: Cumbria, UK
Posts: 80
 

Default

Hi John,

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

Best Regards,
Craig Brass
__________________
Its Elixir - www.itselixir.com
Product: X-Cart Gold
Version: 4.0.17
Status: Live

Its Elixir Wholesale - www.itselixirwholesale.com
Product: X-Cart Gold
Version: 4.0.17
Status: In Development

Real Champagne - www.realchampagne.com
Product: X-Cart Gold
Version: 4.0.17
Status: In Development
Reply With Quote
  #5  
Old 03-07-2006, 12:23 AM
 
junaid junaid is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 96
 

Default

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
__________________
xcart 4.18 on linux
Reply With Quote
  #6  
Old 03-07-2006, 10:24 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

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.
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #7  
Old 03-07-2006, 10:27 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

The integration modules come with the ticket system and the ticket system comes with support suite
Reply With Quote
  #8  
Old 03-07-2006, 10:38 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

Cool looks like i'll be buying that tomorrow then

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.
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #9  
Old 03-07-2006, 10:47 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

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.
Reply With Quote
  #10  
Old 03-07-2006, 10:47 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Also we have some setup/installation FAQ's on our site that may help you as their documentation is severely lacking.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 08:41 PM.

   

 
X-Cart forums © 2001-2020