Version Notes
Adding several new features, and using async script.
Download this release
Release Info
Developer | cSupport Team |
Extension | CSupport_LiveChatPlugin |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- app/code/local/CSupport/LiveChatPlugin/etc/config.xml +5 -3
- app/code/local/CSupport/LiveChatPlugin/etc/system.xml +36 -17
- app/design/frontend/default/default/layout/CSupport_LiveChatPlugin.xml +1 -1
- app/design/frontend/default/default/template/CSupport/LiveChatPlugin/livechat.phtml +43 -17
- package.xml +10 -10
app/code/local/CSupport/LiveChatPlugin/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<CSupport_LiveChatPlugin>
|
5 |
-
<version>1.0.
|
6 |
</CSupport_LiveChatPlugin>
|
7 |
</modules>
|
8 |
<global>
|
@@ -60,11 +60,13 @@
|
|
60 |
<default>
|
61 |
<livechatplugin>
|
62 |
<settings>
|
63 |
-
<auto_fill>Yes</auto_fill>
|
64 |
-
<type>chat-float-inline</type>
|
65 |
<website></website>
|
|
|
|
|
|
|
66 |
<position>b-r</position>
|
67 |
<margin></margin>
|
|
|
68 |
</settings>
|
69 |
</livechatplugin>
|
70 |
</default>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<CSupport_LiveChatPlugin>
|
5 |
+
<version>1.0.2</version>
|
6 |
</CSupport_LiveChatPlugin>
|
7 |
</modules>
|
8 |
<global>
|
60 |
<default>
|
61 |
<livechatplugin>
|
62 |
<settings>
|
|
|
|
|
63 |
<website></website>
|
64 |
+
<type>chat-float-inline</type>
|
65 |
+
<auto_fill>Yes</auto_fill>
|
66 |
+
<autostart>No</autostart>
|
67 |
<position>b-r</position>
|
68 |
<margin></margin>
|
69 |
+
<bgcolor></bgcolor>
|
70 |
</settings>
|
71 |
</livechatplugin>
|
72 |
</default>
|
app/code/local/CSupport/LiveChatPlugin/etc/system.xml
CHANGED
@@ -16,25 +16,25 @@
|
|
16 |
<show_in_website>1</show_in_website>
|
17 |
<show_in_store>1</show_in_store>
|
18 |
<fields>
|
19 |
-
<
|
20 |
-
<label>
|
21 |
-
<frontend_type>
|
22 |
<sort_order>1</sort_order>
|
23 |
-
<source_model>livechatplugin/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>
|
28 |
-
</
|
29 |
-
<
|
30 |
-
<label>
|
31 |
-
<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>
|
37 |
-
</
|
38 |
<auto_fill translate="label comment">
|
39 |
<label>Auto-fill</label>
|
40 |
<frontend_type>select</frontend_type>
|
@@ -43,10 +43,20 @@
|
|
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
|
47 |
</auto_fill>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
</fields>
|
49 |
-
<comment>REMEMBER: You will need a cSupport live chat account. No account? Try a free
|
50 |
</settings>
|
51 |
<layout translate="label comment" module="livechatplugin">
|
52 |
<label>Layout</label>
|
@@ -64,16 +74,25 @@
|
|
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>
|
68 |
</position>
|
69 |
-
<
|
70 |
-
<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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
</margin>
|
78 |
</fields>
|
79 |
</layout>
|
16 |
<show_in_website>1</show_in_website>
|
17 |
<show_in_store>1</show_in_store>
|
18 |
<fields>
|
19 |
+
<website translate="label comment">
|
20 |
+
<label>Your cSupport address: http://</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
<sort_order>1</sort_order>
|
|
|
23 |
<show_in_default>1</show_in_default>
|
24 |
<show_in_website>1</show_in_website>
|
25 |
<show_in_store>1</show_in_store>
|
26 |
+
<comment>Your cSupport domain is your unique address that you registered at cSupport, ie. subdomain.csupporthq.com. Please do not add http://</comment>
|
27 |
+
</website>
|
28 |
+
<type translate="label comment">
|
29 |
+
<label>Type</label>
|
30 |
+
<frontend_type>select</frontend_type>
|
31 |
<sort_order>2</sort_order>
|
32 |
+
<source_model>livechatplugin/types</source_model>
|
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>How the button should work. Inline means that the chat will stay inside the window. Popup means that the chat will popup in a new window.</comment>
|
37 |
+
</type>
|
38 |
<auto_fill translate="label comment">
|
39 |
<label>Auto-fill</label>
|
40 |
<frontend_type>select</frontend_type>
|
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 from Magento.</comment>
|
47 |
</auto_fill>
|
48 |
+
<autostart translate="label comment">
|
49 |
+
<label>Auto start</label>
|
50 |
+
<frontend_type>select</frontend_type>
|
51 |
+
<sort_order>4</sort_order>
|
52 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<show_in_website>1</show_in_website>
|
55 |
+
<show_in_store>1</show_in_store>
|
56 |
+
<comment>Can only be used if auto-fill has been set to Yes.</comment>
|
57 |
+
</autostart>
|
58 |
</fields>
|
59 |
+
<comment>REMEMBER: You will need a cSupport live chat account. No account? Try a free 30-day trial at http://csupporthq.com/pricing/</comment>
|
60 |
</settings>
|
61 |
<layout translate="label comment" module="livechatplugin">
|
62 |
<label>Layout</label>
|
74 |
<show_in_default>1</show_in_default>
|
75 |
<show_in_website>1</show_in_website>
|
76 |
<show_in_store>1</show_in_store>
|
77 |
+
<comment>Select which corner the live chat button should be positioned in.</comment>
|
78 |
</position>
|
79 |
+
<bgcolor translate="label comment">
|
80 |
+
<label>Color (HEX)</label>
|
81 |
<frontend_type>text</frontend_type>
|
82 |
<sort_order>2</sort_order>
|
83 |
<show_in_default>1</show_in_default>
|
84 |
<show_in_website>1</show_in_website>
|
85 |
<show_in_store>1</show_in_store>
|
86 |
+
<comment>The base HEX color to use in the chat. Use a slash (/) with a second HEX color, to add a different color for offline mode.</comment>
|
87 |
+
</bgcolor>
|
88 |
+
<margin translate="label comment">
|
89 |
+
<label>Margin (in pixels)</label>
|
90 |
+
<frontend_type>text</frontend_type>
|
91 |
+
<sort_order>3</sort_order>
|
92 |
+
<show_in_default>1</show_in_default>
|
93 |
+
<show_in_website>1</show_in_website>
|
94 |
+
<show_in_store>1</show_in_store>
|
95 |
+
<comment>The margin in pixels from the edge of the window to the chat button. Only use a number (without px), range from -10 to 100.</comment>
|
96 |
</margin>
|
97 |
</fields>
|
98 |
</layout>
|
app/design/frontend/default/default/layout/CSupport_LiveChatPlugin.xml
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<layout version="1.0.
|
3 |
<default>
|
4 |
<reference name="before_body_end">
|
5 |
<block type="core/template" name="csupport.livechatplugin" as="CSupportLiveChatPlugin" template="CSupport/LiveChatPlugin/livechat.phtml"/>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<layout version="1.0.2">
|
3 |
<default>
|
4 |
<reference name="before_body_end">
|
5 |
<block type="core/template" name="csupport.livechatplugin" as="CSupportLiveChatPlugin" template="CSupport/LiveChatPlugin/livechat.phtml"/>
|
app/design/frontend/default/default/template/CSupport/LiveChatPlugin/livechat.phtml
CHANGED
@@ -1,33 +1,59 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
$type = Mage::getStoreConfig('livechatplugin/settings/type');
|
7 |
-
$tag .=
|
8 |
|
9 |
-
$
|
10 |
-
if($
|
11 |
-
|
|
|
|
|
12 |
$customer = Mage::getSingleton('customer/session');
|
13 |
-
$name = htmlspecialchars($customer->getCustomer()->getFirstname().
|
14 |
$email = $customer->getCustomer()->getEmail();
|
15 |
-
$tag .=
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
17 |
}
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
27 |
}
|
28 |
|
29 |
-
$tag .=
|
30 |
|
31 |
echo $tag;
|
32 |
}
|
33 |
-
?>
|
1 |
<?php
|
2 |
+
Mage::log(__FILE__.':'.__LINE__.' - cSupport Live Chat is working');
|
3 |
+
|
4 |
+
$csupport_domain = Mage::getStoreConfig('livechatplugin/settings/website');
|
5 |
+
Mage::log(__FILE__.':'.__LINE__.' - cSupport Domain: '.$website);
|
6 |
+
|
7 |
+
if (strlen($csupport_domain) > 0)
|
8 |
+
{
|
9 |
+
$tag = '';
|
10 |
|
11 |
$type = Mage::getStoreConfig('livechatplugin/settings/type');
|
12 |
+
$tag .= '<!-- cSupport Live Chat Plugin --><script type="text/javascript">(function(d,c){var scrs=d.getElementsByTagName("script");var scr=scrs[scrs.length-1];var e=d.createElement("script");e.async=true;e.src=("https:"==document.location.protocol?"https://":"http://")+"' . $csupport_domain . '/external/' . $type . '.js?"+scrs.length;if(typeof c=="function")if(e.addEventListener)e.addEventListener("load",c,false);else if(e.readyState)e.onreadystatechange=function(){if(this.readyState=="loaded")c();};scr.parentNode.insertBefore(e,scr);})(document,null);';
|
13 |
|
14 |
+
$csupport_autofill = Mage::getStoreConfig('livechatplugin/settings/auto_fill');
|
15 |
+
if($csupport_autofill=='1')
|
16 |
+
{
|
17 |
+
if(Mage::getSingleton('customer/session')->isLoggedIn())
|
18 |
+
{
|
19 |
$customer = Mage::getSingleton('customer/session');
|
20 |
+
$name = htmlspecialchars($customer->getCustomer()->getFirstname().' '.$customer->getCustomer()->getLastname());
|
21 |
$email = $customer->getCustomer()->getEmail();
|
22 |
+
$tag .= 'var cs_name="' . $name . '";var cs_email="' . $email . '";';
|
23 |
+
|
24 |
+
$csupport_autostart = Mage::getStoreConfig('livechatplugin/settings/autostart');
|
25 |
+
if ($csupport_autostart=='true' || $csupport_autostart=='1')
|
26 |
+
{
|
27 |
+
$tag .= 'var cs_autostart=true;';
|
28 |
+
}
|
29 |
}
|
30 |
}
|
31 |
|
32 |
+
// Add positioning
|
33 |
+
$csupport_position = Mage::getStoreConfig('livechatplugin/layout/position');
|
34 |
+
if ($csupport_position == 't-l' || $csupport_position == 't-r' || $csupport_position == 'b-l' || $csupport_position == 'b-r')
|
35 |
+
{
|
36 |
+
$tag .= 'var cs_position="' . $csupport_position . '";';
|
37 |
+
}
|
38 |
+
|
39 |
+
// Add margin
|
40 |
+
$csupport_margin = Mage::getStoreConfig('livechatplugin/layout/margin');
|
41 |
+
if (strlen($csupport_margin)>0 && is_numeric($csupport_margin))
|
42 |
+
{
|
43 |
+
if ($csupport_margin>100) $csupport_margin=100;
|
44 |
+
elseif ($csupport_margin<-10) $csupport_margin=-10;
|
45 |
+
$tag .='var cs_margin="' . intVal($csupport_margin) . 'px";';
|
46 |
}
|
47 |
|
48 |
+
// Add color
|
49 |
+
$csupport_bgcolor = Mage::getStoreConfig('livechatplugin/layout/bgcolor');
|
50 |
+
if (preg_match('/^#[a-fA-F0-9]{6}(\/#[a-fA-F0-9]{6})?$/i', $csupport_bgcolor))
|
51 |
+
{
|
52 |
+
$tag .= 'var cs_bgcolor="' . $csupport_bgcolor . '";';
|
53 |
}
|
54 |
|
55 |
+
$tag .= '</script><!-- //cSupport Live Chat Plugin -->';
|
56 |
|
57 |
echo $tag;
|
58 |
}
|
59 |
+
?>
|
package.xml
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>CSupport_LiveChatPlugin</name>
|
4 |
-
<version>1.0.
|
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
|
10 |
-
<description>NOTE: This plugin requires a cSupport Live Chat account. You can signup at <a href="
|
11 |

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

|
@@ -21,13 +21,13 @@ cSupport Live Chat features include:
|
|
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 |
-
* Localized into English,
|
25 |
* The live chat service is provided by csupporthq.com. See <a href="https://www.csupporthq.com/">https://www.csupporthq.com/</a> for a full list of features.</description>
|
26 |
-
<notes>
|
27 |
-
<authors><author><name>cSupport Team</name><user>
|
28 |
-
<date>
|
29 |
-
<time>
|
30 |
-
<contents><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="CSupport"><dir name="LiveChatPlugin"><file name="livechat.phtml" hash="
|
31 |
<compatible/>
|
32 |
-
<dependencies
|
33 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>CSupport_LiveChatPlugin</name>
|
4 |
+
<version>1.0.2</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 live vhat button</summary>
|
10 |
+
<description>NOTE: This plugin requires a cSupport Live Chat account. You can signup for a free 30-day trial at <a href="http://csupporthq.com/pricing/">http://csupporthq.com/pricing/</a>
|
11 |

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

|
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 |
+
* Localized into English, Español, Россия, Portugués (Brasil), Český, Dansk, and many more.
|
25 |
* The live chat service is provided by csupporthq.com. See <a href="https://www.csupporthq.com/">https://www.csupporthq.com/</a> for a full list of features.</description>
|
26 |
+
<notes>Adding several new features, and using async script.</notes>
|
27 |
+
<authors><author><name>cSupport Team</name><user>csupporthq</user><email>contact@csupporthq.com</email></author></authors>
|
28 |
+
<date>2013-03-06</date>
|
29 |
+
<time>20:28:49</time>
|
30 |
+
<contents><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="CSupport"><dir name="LiveChatPlugin"><file name="livechat.phtml" hash="a8a367ae0a81a04478c2d6ab4ae976bb"/></dir></dir></dir><dir name="layout"><file name="CSupport_LiveChatPlugin.xml" hash="a8cf13d4d01f30f90f02fc997bda7e92"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="CSupport"><dir><dir name="LiveChatPlugin"><dir name="Helper"><file name="Data.php" hash="00957354badb30b551067f8b446da0bc"/></dir><dir name="Model"><file name="Position.php" hash="7336c26c22506618e223a1fb6e971732"/><file name="Types.php" hash="6bc93a9dcf3884fa2a8242a26a59c81c"/></dir><dir name="etc"><file name="config.xml" hash="82685a70258b4e624d1f038fc5ec424e"/><file name="system.xml" hash="1b21fc43f9d0f18d73d744e8b7f128dd"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="CSupport_LiveChatPlugin.xml" hash="1d9efc6b2d8db7423611c8baa6cab5a5"/></dir></target></contents>
|
31 |
<compatible/>
|
32 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
33 |
</package>
|