Version Notes
Final first version
Download this release
Release Info
Developer | Magento Core Team |
Extension | CSupport_LiveChat |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/local/CSupport/LiveChat/Helper/Data.php +4 -0
- app/code/local/CSupport/LiveChat/Model/Placement.php +15 -0
- app/code/local/CSupport/LiveChat/Model/Types.php +13 -0
- app/code/local/CSupport/LiveChat/etc/config.xml +71 -0
- app/code/local/CSupport/LiveChat/etc/system.xml +83 -0
- app/design/frontend/default/default/layout/CSupport_LiveChat.xml +8 -0
- app/design/frontend/default/default/template/CSupport/LiveChat/livechat.phtml +34 -0
- app/etc/modules/CSupport_LiveChat.xml +9 -0
- package.xml +34 -0
app/code/local/CSupport/LiveChat/Helper/Data.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class CSupport_LiveChat_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
}
|
app/code/local/CSupport/LiveChat/Model/Placement.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class CSupport_LiveChat_Model_Placement
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
return array(
|
7 |
+
array('value'=>"b-r", 'label'=>Mage::helper('livechat')->__('Bottom Right')),
|
8 |
+
array('value'=>"b-l", 'label'=>Mage::helper('livechat')->__('Bottom Left')),
|
9 |
+
array('value'=>"t-r", 'label'=>Mage::helper('livechat')->__('Top Right')),
|
10 |
+
array('value'=>"t-l", 'label'=>Mage::helper('livechat')->__('Top Left')),
|
11 |
+
);
|
12 |
+
}
|
13 |
+
|
14 |
+
}
|
15 |
+
?>
|
app/code/local/CSupport/LiveChat/Model/Types.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class CSupport_LiveChat_Model_Types
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
return array(
|
7 |
+
array('value'=>"chat-float-inline", 'label'=>Mage::helper('livechat')->__('Floating Inline Chat Button')),
|
8 |
+
array('value'=>"chat-float", 'label'=>Mage::helper('livechat')->__('Floating Popup Chat Button')),
|
9 |
+
);
|
10 |
+
}
|
11 |
+
|
12 |
+
}
|
13 |
+
?>
|
app/code/local/CSupport/LiveChat/etc/config.xml
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<CSupport_LiveChat>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</CSupport_LiveChat>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<helpers>
|
10 |
+
<livechat>
|
11 |
+
<class>CSupport_LiveChat_Helper</class>
|
12 |
+
</livechat>
|
13 |
+
</helpers>
|
14 |
+
<models>
|
15 |
+
<livechat>
|
16 |
+
<class>CSupport_LiveChat_Model</class>
|
17 |
+
</livechat>
|
18 |
+
</models>
|
19 |
+
</global>
|
20 |
+
<frontend>
|
21 |
+
<layout>
|
22 |
+
<updates>
|
23 |
+
<csupport>
|
24 |
+
<file>CSupport_LiveChat.xml</file>
|
25 |
+
</csupport>
|
26 |
+
</updates>
|
27 |
+
</layout>
|
28 |
+
</frontend>
|
29 |
+
<adminhtml>
|
30 |
+
<acl>
|
31 |
+
<resources>
|
32 |
+
<admin>
|
33 |
+
<children>
|
34 |
+
<system>
|
35 |
+
<children>
|
36 |
+
<config>
|
37 |
+
<children>
|
38 |
+
<livechat>
|
39 |
+
<title>cSupport Live Chat</title>
|
40 |
+
<sort_order>100</sort_order>
|
41 |
+
</livechat>
|
42 |
+
</children>
|
43 |
+
</config>
|
44 |
+
</children>
|
45 |
+
</system>
|
46 |
+
</children>
|
47 |
+
</admin>
|
48 |
+
</resources>
|
49 |
+
</acl>
|
50 |
+
<translate>
|
51 |
+
<modules>
|
52 |
+
<CSupport_LiveChat>
|
53 |
+
<files>
|
54 |
+
<default>CSupport_LiveChat.csv</default>
|
55 |
+
</files>
|
56 |
+
</CSupport_LiveChat>
|
57 |
+
</modules>
|
58 |
+
</translate>
|
59 |
+
</adminhtml>
|
60 |
+
<default>
|
61 |
+
<livechat>
|
62 |
+
<settings>
|
63 |
+
<auto_fill>Yes</auto_fill>
|
64 |
+
<type>chat-float-inline</type>
|
65 |
+
<website></website>
|
66 |
+
<placement>b-r</placement>
|
67 |
+
<margin></margin>
|
68 |
+
</settings>
|
69 |
+
</livechat>
|
70 |
+
</default>
|
71 |
+
</config>
|
app/code/local/CSupport/LiveChat/etc/system.xml
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<sections>
|
3 |
+
<livechat translate="label comment" module="livechat">
|
4 |
+
<tab>general</tab>
|
5 |
+
<label>cSupport Live Chat</label>
|
6 |
+
<sort_order>10000</sort_order>
|
7 |
+
<show_in_default>1</show_in_default>
|
8 |
+
<show_in_website>1</show_in_website>
|
9 |
+
<show_in_store>1</show_in_store>
|
10 |
+
<groups>
|
11 |
+
<settings translate="label comment" module="livechat">
|
12 |
+
<label>General Settings</label>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>1</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<fields>
|
19 |
+
<type translate="label comment">
|
20 |
+
<label>Type</label>
|
21 |
+
<frontend_type>select</frontend_type>
|
22 |
+
<sort_order>1</sort_order>
|
23 |
+
<source_model>livechat/types</source_model>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>1</show_in_website>
|
26 |
+
<show_in_store>1</show_in_store>
|
27 |
+
<comment>Select the type of inline button you wish</comment>
|
28 |
+
</type>
|
29 |
+
<website translate="label comment">
|
30 |
+
<label>Your domain (without http//www.)</label>
|
31 |
+
<frontend_type>text</frontend_type>
|
32 |
+
<sort_order>2</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
<comment>Your domain is your unique address, ie. yourdomain.csupporthq.com. Please do not add http://</comment>
|
37 |
+
</website>
|
38 |
+
<auto_fill translate="label comment">
|
39 |
+
<label>Auto-fill</label>
|
40 |
+
<frontend_type>select</frontend_type>
|
41 |
+
<sort_order>3</sort_order>
|
42 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
<comment>If possible, auto-fill with customer information</comment>
|
47 |
+
</auto_fill>
|
48 |
+
</fields>
|
49 |
+
<comment>REMEMBER: You will need a cSupport live chat account. No account? Try a free 14-day trial at https://csupporthq.com/pricing/</comment>
|
50 |
+
</settings>
|
51 |
+
<layout translate="label comment" module="livechat">
|
52 |
+
<label>Layout</label>
|
53 |
+
<frontend_type>text</frontend_type>
|
54 |
+
<sort_order>2</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
<fields>
|
59 |
+
<placement translate="label comment">
|
60 |
+
<label>Placement</label>
|
61 |
+
<frontend_type>select</frontend_type>
|
62 |
+
<sort_order>1</sort_order>
|
63 |
+
<source_model>livechat/placement</source_model>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>1</show_in_store>
|
67 |
+
<comment>The placement of the live chat button</comment>
|
68 |
+
</placement>
|
69 |
+
<margin translate="label comment">
|
70 |
+
<label>Margin</label>
|
71 |
+
<frontend_type>text</frontend_type>
|
72 |
+
<sort_order>2</sort_order>
|
73 |
+
<show_in_default>1</show_in_default>
|
74 |
+
<show_in_website>1</show_in_website>
|
75 |
+
<show_in_store>1</show_in_store>
|
76 |
+
<comment>The margin in pixels from the edge. Only put in numbers!</comment>
|
77 |
+
</margin>
|
78 |
+
</fields>
|
79 |
+
</layout>
|
80 |
+
</groups>
|
81 |
+
</livechat>
|
82 |
+
</sections>
|
83 |
+
</config>
|
app/design/frontend/default/default/layout/CSupport_LiveChat.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="1.0.0">
|
3 |
+
<default>
|
4 |
+
<reference name="before_body_end">
|
5 |
+
<block type="core/template" name="csupport.livechat" as="cSupportLiveChat" template="cSupport/LiveChat/livechat.phtml"/>
|
6 |
+
</reference>
|
7 |
+
</default>
|
8 |
+
</layout>
|
app/design/frontend/default/default/template/CSupport/LiveChat/livechat.phtml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$website = Mage::getStoreConfig('livechat/settings/website',Mage::app()->getStore());
|
3 |
+
if($website!=""){
|
4 |
+
$tag = "";
|
5 |
+
|
6 |
+
$type = Mage::getStoreConfig('livechat/settings/type');
|
7 |
+
$tag .= "<!-- cSupport Live Chat Plugin --><script type='text/javascript'>(function() { var src = ('https:' == document.location.protocol ? 'https://' : 'http://') + '".$website."/external/".$type.".js';document.write(\"<script src='\"+src+\"' type='text/javascript'><\/script>\");})();";
|
8 |
+
|
9 |
+
$auto_fill = Mage::getStoreConfig('livechat/settings/auto_fill');
|
10 |
+
error_log($auto_fill);
|
11 |
+
if($auto_fill=='1'){
|
12 |
+
if(Mage::getSingleton('customer/session')->isLoggedIn()){
|
13 |
+
$customer = Mage::getSingleton('customer/session');
|
14 |
+
$name = htmlspecialchars($customer->getCustomer()->getFirstname()." ".$customer->getCustomer()->getLastname());
|
15 |
+
$email = $customer->getCustomer()->getEmail();
|
16 |
+
$tag .= "var cs_name=\"".$name."\";var cs_email=\"".$email."\";";
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
$placement = Mage::getStoreConfig('livechat/layout/placement');
|
21 |
+
if($placement=="t-l" || $placement=="t-r" || $placement=="b-l" || $placement=="b-r"){
|
22 |
+
$tag .= "var cs_placement=\"".$placement."\";";
|
23 |
+
}
|
24 |
+
|
25 |
+
$margin = intval(Mage::getStoreConfig('livechat/layout/margin'));
|
26 |
+
if($margin>0 && $margin<101){
|
27 |
+
$tag .="var cs_margin=\"".$margin."px\";";
|
28 |
+
}
|
29 |
+
|
30 |
+
$tag .= "</script><!-- //cSupport Live Chat Plugin -->";
|
31 |
+
|
32 |
+
echo $tag;
|
33 |
+
}
|
34 |
+
?>
|
app/etc/modules/CSupport_LiveChat.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<cSupport_LiveChat>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</cSupport_LiveChat>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>CSupport_LiveChat</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>This plugin implements the cSupport Inline Floating Live Chat button</summary>
|
10 |
+
<description>Extend the human contact. Talk directly with your website visitors!
|
11 |
+

|
12 |
+
This plugin implements an inline Live Chat button to the bottom right of your Magento site.
|
13 |
+

|
14 |
+
cSupport Live Chat features include:
|
15 |
+

|
16 |
+
* No client software to download
|
17 |
+
* Service live chats from any browser, including smart phones
|
18 |
+
* Service multiple visitors simultaneously
|
19 |
+
* Predefined responses
|
20 |
+
* Contact form for when you are not available/online to serve chats
|
21 |
+
* Jabber/Google Talk integration to chat with your website visitors directly from your favorite IM application (on your mobile as well)
|
22 |
+
* Reliable and secure
|
23 |
+
* Complete chat history available for visitors and for the website administrator
|
24 |
+
* The live chat service is provided by csupporthq.com. See https://www.csupporthq.com/ for a full list of features.
|
25 |
+

|
26 |
+
REMEMBER: This plugin requires a cSupport Live Chat account. You can signup at https://csupporthq.com/pricing/</description>
|
27 |
+
<notes>Final first version</notes>
|
28 |
+
<authors><author><name>cSupport Team</name><user>auto-converted</user><email>contact@csupporthq.com</email></author></authors>
|
29 |
+
<date>2011-12-31</date>
|
30 |
+
<time>20:30:11</time>
|
31 |
+
<contents><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="CSupport"><dir name="LiveChat"><file name="livechat.phtml" hash="6c2a4dae8c604f64234ed02c72f1fcb8"/></dir></dir></dir><dir name="layout"><file name="CSupport_LiveChat.xml" hash="35c6136711c92a3a888c5410c9a031ab"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="CSupport"><dir name="LiveChat"><dir name="Helper"><file name="Data.php" hash="8008c02ccffe2323bcddeae4520a94b3"/></dir><dir name="Model"><file name="Placement.php" hash="2576f26b133269a3e745cd59e31b5820"/><file name="Types.php" hash="6bccb350cda86845501a58ddebdd2c89"/></dir><dir name="etc"><file name="config.xml" hash="d483a56e53a51e912edf922517c2363c"/><file name="system.xml" hash="5720cba512b7bada5e5d9d054440eec4"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CSupport_LiveChat.xml" hash="4fd3f1f73381d31d8446b9bbaa474654"/></dir></target></contents>
|
32 |
+
<compatible/>
|
33 |
+
<dependencies/>
|
34 |
+
</package>
|