Version Notes
New:
added server cache support
Download this release
Release Info
Developer | a.laciura@sostanza.it |
Extension | Sostanza_LiveHelp |
Version | 1.6.0 |
Comparing to | |
See all releases |
Code changes from version 1.5.5 to 1.6.0
- app/code/community/Sostanza/Livehelp/Block/Functions.php +10 -65
- app/code/community/Sostanza/Livehelp/Helper/Data.php +1 -0
- app/code/community/Sostanza/Livehelp/Model/Config/Source/GetCool.php +0 -1
- app/code/community/Sostanza/Livehelp/Model/Config/Source/GetLivehelpButton.php +0 -47
- app/code/community/Sostanza/Livehelp/Model/Config/Source/GetLivehelpPosition.php +0 -19
- app/code/community/Sostanza/Livehelp/controllers/IndexController.php +17 -0
- app/code/community/Sostanza/Livehelp/etc/adminhtml.xml +42 -42
- app/code/community/Sostanza/Livehelp/etc/config.xml +10 -0
- app/code/community/Sostanza/Livehelp/etc/system.xml +26 -58
- app/design/frontend/base/default/template/livehelp/widget.phtml +23 -45
- package.xml +10 -11
app/code/community/Sostanza/Livehelp/Block/Functions.php
CHANGED
@@ -18,84 +18,29 @@ class Sostanza_Livehelp_Block_Functions extends Mage_Core_Block_Template
|
|
18 |
public function getLivehelpID()
|
19 |
{
|
20 |
if ($this->_livehelpID === false)
|
21 |
-
|
22 |
|
23 |
return $this->_livehelpID;
|
24 |
}
|
25 |
-
public function getWidgetMethod()
|
26 |
-
{
|
27 |
-
if ($this->_method === false)
|
28 |
-
$this->_method = Mage::getStoreConfig('livehelp/widget/method');
|
29 |
-
return $this->_method;
|
30 |
-
}
|
31 |
-
public function isCool()
|
32 |
-
{
|
33 |
-
return Mage::getStoreConfigFlag('livehelp/widget/method') && $this->getWidgetMethod();
|
34 |
-
}
|
35 |
-
|
36 |
-
public function getButton()
|
37 |
-
{
|
38 |
-
if ($this->_button === false)
|
39 |
-
$this->_button = Mage::getStoreConfig('livehelp/classicconfig/button_live');
|
40 |
-
return $this->_button;
|
41 |
-
}
|
42 |
-
public function getPosition()
|
43 |
-
{
|
44 |
-
if ($this->_position === false)
|
45 |
-
$this->_position = Mage::getStoreConfig('livehelp/classicconfig/button_position');
|
46 |
-
return $this->_position;
|
47 |
-
}
|
48 |
public function getDynamic()
|
49 |
{
|
50 |
if ($this->_dynamic === false)
|
51 |
-
|
52 |
return $this->_dynamic;
|
53 |
}
|
54 |
public function getCart()
|
55 |
{
|
56 |
if ($this->_cart === false)
|
57 |
-
|
58 |
return $this->_cart;
|
59 |
}
|
60 |
public function trackOrder()
|
61 |
{
|
62 |
if ($this->_trackorder === false)
|
63 |
-
|
64 |
return $this->_trackorder;
|
65 |
}
|
66 |
|
67 |
-
public function getCartLHInfo()
|
68 |
-
{
|
69 |
-
$cliente=Mage::getSingleton('customer/session')->getCustomer()->getId();
|
70 |
-
|
71 |
-
//se � guest mostro i prodotti nel carrello
|
72 |
-
if (!isset($cliente)){
|
73 |
-
|
74 |
-
//se non si vuole passare il carrello all'operatore cambiare la riga sopra in:
|
75 |
-
//$LHinfo="Guest";
|
76 |
-
$session_id = Mage::getSingleton("core/session")->getEncryptedSessionId(); // get our session
|
77 |
-
$MAGENTOcart=Mage::getUrl( 'checkout/cart/', array(
|
78 |
-
'_query' => array('SID' => $session_id ), //make sure we append our session
|
79 |
-
'_store_to_url' => true ) ); // lastly add store to our url if needed
|
80 |
-
}
|
81 |
-
//altrimenti passo id utente
|
82 |
-
else{
|
83 |
-
$session_id = Mage::getSingleton("core/session")->getEncryptedSessionId(); // get our session
|
84 |
-
$MAGENTOcart=Mage::getUrl( 'customer/account/', array(
|
85 |
-
'_query' => array('SID' => $session_id ), //make sure we append our session
|
86 |
-
'_store_to_url' => true ) ); // lastly add store to our url if needed
|
87 |
-
|
88 |
-
}
|
89 |
-
|
90 |
-
$count = $this->helper('checkout/cart')->getSummaryCount();
|
91 |
-
$total = $this->helper('checkout/cart')->getQuote()->getGrandTotal();
|
92 |
-
|
93 |
-
if($count!=0){
|
94 |
-
return "Totale:".$total." "."Item:".$count." ".$MAGENTOcart;
|
95 |
-
}else{
|
96 |
-
return $MAGENTOcart;
|
97 |
-
}
|
98 |
-
}
|
99 |
public function trackCustomerOrder(){
|
100 |
$sOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
101 |
$oOrder = Mage::getModel('sales/order')->load($sOrderId);
|
@@ -103,13 +48,13 @@ class Sostanza_Livehelp_Block_Functions extends Mage_Core_Block_Template
|
|
103 |
$TOTorder=number_format((float)$TOTorder, 2, '.', '');
|
104 |
$nordine=$oOrder->getIncrementId();?>
|
105 |
<script>
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
|
112 |
-
|
113 |
</script>
|
114 |
<?php
|
115 |
}
|
18 |
public function getLivehelpID()
|
19 |
{
|
20 |
if ($this->_livehelpID === false)
|
21 |
+
$this->_livehelpID = Mage::getStoreConfig('livehelp/widget/lhid');
|
22 |
|
23 |
return $this->_livehelpID;
|
24 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
public function getDynamic()
|
26 |
{
|
27 |
if ($this->_dynamic === false)
|
28 |
+
$this->_dynamic = Mage::getStoreConfig('livehelp/advancedconfig/filter');
|
29 |
return $this->_dynamic;
|
30 |
}
|
31 |
public function getCart()
|
32 |
{
|
33 |
if ($this->_cart === false)
|
34 |
+
$this->_cart = Mage::getStoreConfig('livehelp/advancedconfig/cart');
|
35 |
return $this->_cart;
|
36 |
}
|
37 |
public function trackOrder()
|
38 |
{
|
39 |
if ($this->_trackorder === false)
|
40 |
+
$this->_trackorder = Mage::getStoreConfig('livehelp/advancedconfig/trackorder');
|
41 |
return $this->_trackorder;
|
42 |
}
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
public function trackCustomerOrder(){
|
45 |
$sOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
46 |
$oOrder = Mage::getModel('sales/order')->load($sOrderId);
|
48 |
$TOTorder=number_format((float)$TOTorder, 2, '.', '');
|
49 |
$nordine=$oOrder->getIncrementId();?>
|
50 |
<script>
|
51 |
+
//track ordine livehelp
|
52 |
+
totale="<?php echo $TOTorder ?>";
|
53 |
+
LHamount=totale.replace('.','');
|
54 |
+
LHamount=LHamount.replace(',','');
|
55 |
+
LHorderID='<?php echo $nordine ?>';
|
56 |
|
57 |
+
document.write('<iframe src="//server.livehelp.it/admin/resa_livehelp.asp?gruppo=<?php echo $this->getLivehelpID(); ?>&amount=' + LHamount + '&orderID=' + LHorderID + '" height="0" width="0" style="display:none;visibility:hidden"></iframe>');
|
58 |
</script>
|
59 |
<?php
|
60 |
}
|
app/code/community/Sostanza/Livehelp/Helper/Data.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
2 |
class Sostanza_Livehelp_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
{
|
|
|
4 |
}
|
1 |
<?php
|
2 |
class Sostanza_Livehelp_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
{
|
4 |
+
|
5 |
}
|
app/code/community/Sostanza/Livehelp/Model/Config/Source/GetCool.php
CHANGED
@@ -31,7 +31,6 @@ $resp = curl_exec($curl);
|
|
31 |
|
32 |
curl_close($curl);
|
33 |
$resp= substr_replace($resp ,"",-1);
|
34 |
-
$resp="0=>Choose a widget...,".$resp;
|
35 |
$asArr = explode(',', $resp);
|
36 |
|
37 |
foreach( $asArr as $val ){
|
31 |
|
32 |
curl_close($curl);
|
33 |
$resp= substr_replace($resp ,"",-1);
|
|
|
34 |
$asArr = explode(',', $resp);
|
35 |
|
36 |
foreach( $asArr as $val ){
|
app/code/community/Sostanza/Livehelp/Model/Config/Source/GetLivehelpButton.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Sostanza_Livehelp_Model_Config_Source_getLivehelpButton
|
4 |
-
{
|
5 |
-
|
6 |
-
|
7 |
-
protected $_livehelpID = false;
|
8 |
-
|
9 |
-
public function getLivehelpID() {
|
10 |
-
|
11 |
-
if($this->_livehelpID === false)
|
12 |
-
|
13 |
-
$this->_livehelpID = Mage::getStoreConfig('livehelp/widget/lhid');
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
return $this->_livehelpID;
|
18 |
-
|
19 |
-
}
|
20 |
-
public function toOptionArray()
|
21 |
-
{
|
22 |
-
|
23 |
-
$curl = curl_init();
|
24 |
-
$id=$this->getLivehelpID();
|
25 |
-
|
26 |
-
curl_setopt_array($curl, array(
|
27 |
-
CURLOPT_RETURNTRANSFER => 1,
|
28 |
-
CURLOPT_URL => 'http://server.livehelp.it/admin/widget_elenco_ajax_magento.asp?idgruppo='.$id.'&bot=1'
|
29 |
-
));
|
30 |
-
// Send the request & save response to $resp
|
31 |
-
$resp = curl_exec($curl);
|
32 |
-
// Close request to clear up some resources
|
33 |
-
curl_close($curl);
|
34 |
-
|
35 |
-
|
36 |
-
$resp="0=>Choose a button...,".$resp;
|
37 |
-
$asArr = explode(',', $resp);
|
38 |
-
|
39 |
-
foreach( $asArr as $val ){
|
40 |
-
$tmp = explode( '=>', $val );
|
41 |
-
$finalArray[ $tmp[0] ] = $tmp[1];
|
42 |
-
}
|
43 |
-
return $finalArray;
|
44 |
-
|
45 |
-
}
|
46 |
-
}
|
47 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sostanza/Livehelp/Model/Config/Source/GetLivehelpPosition.php
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Sostanza_Livehelp_Model_Config_Source_GetLivehelpPosition
|
4 |
-
{
|
5 |
-
/**
|
6 |
-
* Options getter
|
7 |
-
*
|
8 |
-
* @return array
|
9 |
-
*/
|
10 |
-
public function toOptionArray()
|
11 |
-
{
|
12 |
-
return array(
|
13 |
-
array('value' => '0', 'label' => Mage::helper('livehelp')->__('Choose the position...')),
|
14 |
-
array('value' => 'l', 'label' => Mage::helper('livehelp')->__('Integrated in website graphic')),
|
15 |
-
array('value' => '2', 'label' => Mage::helper('livehelp')->__('Fixed at the bottom right')),
|
16 |
-
array('value' => '3', 'label' => Mage::helper('livehelp')->__('Fixed at the bottom left')),
|
17 |
-
);
|
18 |
-
}
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Sostanza/Livehelp/controllers/IndexController.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Sostanza_Livehelp_IndexController extends Mage_Core_Controller_Front_Action
|
4 |
+
{
|
5 |
+
public function getcartlhinfoAction()
|
6 |
+
{
|
7 |
+
$session_id = Mage::getSingleton("core/session")->getEncryptedSessionId(); // get our session
|
8 |
+
$MAGENTOcart=Mage::getUrl( 'checkout/cart/', array(
|
9 |
+
'_secure'=>true,
|
10 |
+
'_query' => array('SID' => $session_id ), //make sure we append our session
|
11 |
+
'_store_to_url' => true ) ); // lastly add store to our url if needed
|
12 |
+
echo $MAGENTOcart;
|
13 |
+
|
14 |
+
}
|
15 |
+
|
16 |
+
}
|
17 |
+
?>
|
app/code/community/Sostanza/Livehelp/etc/adminhtml.xml
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<config>
|
3 |
-
<menu>
|
4 |
-
<livehelp module="livehelp" translate="title">
|
5 |
-
<title>LiveHelp®</title>
|
6 |
-
<sort_order>10000</sort_order>
|
7 |
-
<children>
|
8 |
-
<index module="livehelp" translate="title">
|
9 |
-
<title>Configure plugin</title>
|
10 |
-
<sort_order>1</sort_order>
|
11 |
-
<action>adminhtml/system_config/edit/section/livehelp</action>
|
12 |
-
</index>
|
13 |
-
</children>
|
14 |
-
</livehelp>
|
15 |
-
</menu>
|
16 |
-
<acl>
|
17 |
-
<resources>
|
18 |
-
<admin>
|
19 |
-
<children>
|
20 |
-
<sostanza_livehelp>
|
21 |
-
<children>
|
22 |
-
<livehelp>
|
23 |
-
<title>livehelp</title>
|
24 |
-
<sort_order>50</sort_order>
|
25 |
-
</livehelp>
|
26 |
-
</children>
|
27 |
-
</sostanza_livehelp>
|
28 |
-
<system>
|
29 |
-
<children>
|
30 |
-
<config>
|
31 |
-
<children>
|
32 |
-
<livehelp>
|
33 |
-
<title>Sostanza livehelp</title>
|
34 |
-
</livehelp>
|
35 |
-
</children>
|
36 |
-
</config>
|
37 |
-
</children>
|
38 |
-
</system>
|
39 |
-
</children>
|
40 |
-
</admin>
|
41 |
-
</resources>
|
42 |
-
</acl>
|
43 |
</config>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<livehelp module="livehelp" translate="title">
|
5 |
+
<title>LiveHelp®</title>
|
6 |
+
<sort_order>10000</sort_order>
|
7 |
+
<children>
|
8 |
+
<index module="livehelp" translate="title">
|
9 |
+
<title>Configure plugin</title>
|
10 |
+
<sort_order>1</sort_order>
|
11 |
+
<action>adminhtml/system_config/edit/section/livehelp</action>
|
12 |
+
</index>
|
13 |
+
</children>
|
14 |
+
</livehelp>
|
15 |
+
</menu>
|
16 |
+
<acl>
|
17 |
+
<resources>
|
18 |
+
<admin>
|
19 |
+
<children>
|
20 |
+
<sostanza_livehelp>
|
21 |
+
<children>
|
22 |
+
<livehelp>
|
23 |
+
<title>livehelp</title>
|
24 |
+
<sort_order>50</sort_order>
|
25 |
+
</livehelp>
|
26 |
+
</children>
|
27 |
+
</sostanza_livehelp>
|
28 |
+
<system>
|
29 |
+
<children>
|
30 |
+
<config>
|
31 |
+
<children>
|
32 |
+
<livehelp>
|
33 |
+
<title>Sostanza livehelp</title>
|
34 |
+
</livehelp>
|
35 |
+
</children>
|
36 |
+
</config>
|
37 |
+
</children>
|
38 |
+
</system>
|
39 |
+
</children>
|
40 |
+
</admin>
|
41 |
+
</resources>
|
42 |
+
</acl>
|
43 |
</config>
|
app/code/community/Sostanza/Livehelp/etc/config.xml
CHANGED
@@ -23,6 +23,15 @@
|
|
23 |
</models>
|
24 |
</global>
|
25 |
<frontend>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
<layout>
|
27 |
<updates>
|
28 |
<livehelp>
|
@@ -40,6 +49,7 @@
|
|
40 |
</modules>
|
41 |
</args>
|
42 |
</adminhtml>
|
|
|
43 |
</routers>
|
44 |
</admin>
|
45 |
</config>
|
23 |
</models>
|
24 |
</global>
|
25 |
<frontend>
|
26 |
+
<routers>
|
27 |
+
<livehelp>
|
28 |
+
<use>standard</use>
|
29 |
+
<args>
|
30 |
+
<module>Sostanza_Livehelp</module>
|
31 |
+
<frontName>livehelp</frontName>
|
32 |
+
</args>
|
33 |
+
</livehelp>
|
34 |
+
</routers>
|
35 |
<layout>
|
36 |
<updates>
|
37 |
<livehelp>
|
49 |
</modules>
|
50 |
</args>
|
51 |
</adminhtml>
|
52 |
+
|
53 |
</routers>
|
54 |
</admin>
|
55 |
</config>
|
app/code/community/Sostanza/Livehelp/etc/system.xml
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
<config>
|
3 |
<tabs>
|
4 |
<livehelp_config module="livehelp" translate="label">
|
5 |
-
<label>Livehelp
|
6 |
<sort_order>1</sort_order>
|
7 |
-
</livehelp_config>
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
<livehelp translate="label" module="livehelp">
|
@@ -16,7 +16,7 @@
|
|
16 |
<show_in_website>1</show_in_website>
|
17 |
<show_in_store>1</show_in_store>
|
18 |
<groups>
|
19 |
-
|
20 |
<frontend_model>livehelp/adminhtml_config_source_buttons</frontend_model>
|
21 |
<sort_order>0</sort_order>
|
22 |
<show_in_default>1</show_in_default>
|
@@ -32,7 +32,7 @@
|
|
32 |
<show_in_store>1</show_in_store>
|
33 |
<fields>
|
34 |
<active module="livehelp" translate="label">
|
35 |
-
<label>Enable Livehelp
|
36 |
<frontend_type>select</frontend_type>
|
37 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
38 |
<sort_order>1</sort_order>
|
@@ -41,31 +41,23 @@
|
|
41 |
<show_in_store>1</show_in_store>
|
42 |
</active>
|
43 |
<lhid module="livehelp" translate="label">
|
44 |
-
<label>Livehelp
|
45 |
<frontend_type>text</frontend_type>
|
46 |
<sort_order>2</sort_order>
|
47 |
<show_in_default>1</show_in_default>
|
48 |
<show_in_website>1</show_in_website>
|
49 |
<show_in_store>1</show_in_store>
|
50 |
-
<comment
|
|
|
51 |
</comment>
|
52 |
<depends>
|
53 |
<active>1</active>
|
54 |
</depends>
|
55 |
-
</lhid>
|
56 |
-
|
57 |
-
<label>I want to use the old easy way configuration</label>
|
58 |
-
<frontend_type>select</frontend_type>
|
59 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
60 |
-
<sort_order>3</sort_order>
|
61 |
-
<show_in_default>1</show_in_default>
|
62 |
-
<show_in_website>1</show_in_website>
|
63 |
-
<show_in_store>1</show_in_store>
|
64 |
-
</method>
|
65 |
-
</fields>
|
66 |
</widget>
|
67 |
<advancedconfig module="livehelp" translate="label">
|
68 |
-
<label>Widget Configuration
|
69 |
<frontend_type>text</frontend_type>
|
70 |
<sort_order>20</sort_order>
|
71 |
<show_in_default>1</show_in_default>
|
@@ -74,19 +66,23 @@
|
|
74 |
<depends>
|
75 |
<widget_method>2</widget_method>
|
76 |
</depends>
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
80 |
<label>Choose a dynamic js widget</label>
|
81 |
<frontend_type>select</frontend_type>
|
82 |
<source_model>livehelp/config_source_GetCool</source_model>
|
83 |
-
<comment
|
|
|
|
|
84 |
<sort_order>1</sort_order>
|
85 |
<show_in_default>2</show_in_default>
|
86 |
<show_in_website>1</show_in_website>
|
87 |
<show_in_store>1</show_in_store>
|
88 |
</filter>
|
89 |
-
|
90 |
<label>Let agents view/edit cart details</label>
|
91 |
<frontend_type>select</frontend_type>
|
92 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
@@ -94,49 +90,21 @@
|
|
94 |
<show_in_default>1</show_in_default>
|
95 |
<show_in_website>1</show_in_website>
|
96 |
<show_in_store>1</show_in_store>
|
97 |
-
</cart>
|
98 |
-
|
99 |
<label>Track your orders</label>
|
100 |
<frontend_type>select</frontend_type>
|
101 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
|
|
|
|
|
|
102 |
<sort_order>3</sort_order>
|
103 |
<show_in_default>1</show_in_default>
|
104 |
<show_in_website>1</show_in_website>
|
105 |
<show_in_store>1</show_in_store>
|
106 |
-
</trackorder>
|
107 |
</fields>
|
108 |
-
</advancedconfig>
|
109 |
-
<classicconfig module="livehelp" translate="label comment">
|
110 |
-
<label>Widget Configuration: The old easy way</label>
|
111 |
-
<frontend_type>text</frontend_type>
|
112 |
-
<sort_order>30</sort_order>
|
113 |
-
<show_in_default>2</show_in_default>
|
114 |
-
<show_in_website>1</show_in_website>
|
115 |
-
<show_in_store>1</show_in_store>
|
116 |
-
<fields>
|
117 |
-
<button_live module="livehelp" translate="label comment">
|
118 |
-
<label>Choose a button</label>
|
119 |
-
<frontend_type>select</frontend_type>
|
120 |
-
<!-- scelgo il tipo di congifurazione-->
|
121 |
-
<source_model>livehelp/config_source_getLivehelpButton</source_model>
|
122 |
-
<comment><![CDATA[The image of the button.]]></comment>
|
123 |
-
<sort_order>1</sort_order>
|
124 |
-
<show_in_default>1</show_in_default>
|
125 |
-
<show_in_website>1</show_in_website>
|
126 |
-
<show_in_store>1</show_in_store>
|
127 |
-
</button_live>
|
128 |
-
<button_position module="livehelp" translate="label comment">
|
129 |
-
<label>Position</label>
|
130 |
-
<frontend_type>select</frontend_type>
|
131 |
-
<source_model>livehelp/config_source_GetLivehelpPosition</source_model>
|
132 |
-
<comment><![CDATA[The position in the page of the button.]]></comment>
|
133 |
-
<sort_order>2</sort_order>
|
134 |
-
<show_in_default>1</show_in_default>
|
135 |
-
<show_in_website>1</show_in_website>
|
136 |
-
<show_in_store>1</show_in_store>
|
137 |
-
</button_position>
|
138 |
-
</fields>
|
139 |
-
</classicconfig>
|
140 |
</groups>
|
141 |
</livehelp>
|
142 |
</sections>
|
2 |
<config>
|
3 |
<tabs>
|
4 |
<livehelp_config module="livehelp" translate="label">
|
5 |
+
<label>Livehelp</label>
|
6 |
<sort_order>1</sort_order>
|
7 |
+
</livehelp_config>
|
8 |
</tabs>
|
9 |
<sections>
|
10 |
<livehelp translate="label" module="livehelp">
|
16 |
<show_in_website>1</show_in_website>
|
17 |
<show_in_store>1</show_in_store>
|
18 |
<groups>
|
19 |
+
<buttons>
|
20 |
<frontend_model>livehelp/adminhtml_config_source_buttons</frontend_model>
|
21 |
<sort_order>0</sort_order>
|
22 |
<show_in_default>1</show_in_default>
|
32 |
<show_in_store>1</show_in_store>
|
33 |
<fields>
|
34 |
<active module="livehelp" translate="label">
|
35 |
+
<label>Enable Livehelp</label>
|
36 |
<frontend_type>select</frontend_type>
|
37 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
38 |
<sort_order>1</sort_order>
|
41 |
<show_in_store>1</show_in_store>
|
42 |
</active>
|
43 |
<lhid module="livehelp" translate="label">
|
44 |
+
<label>Livehelp ID</label>
|
45 |
<frontend_type>text</frontend_type>
|
46 |
<sort_order>2</sort_order>
|
47 |
<show_in_default>1</show_in_default>
|
48 |
<show_in_website>1</show_in_website>
|
49 |
<show_in_store>1</show_in_store>
|
50 |
+
<comment>
|
51 |
+
<![CDATA[This is the 5-digit key provided in your subscription email (without ID-). <b>Click "Save Config"</b> to update the widget list.<br /> ]]>
|
52 |
</comment>
|
53 |
<depends>
|
54 |
<active>1</active>
|
55 |
</depends>
|
56 |
+
</lhid>
|
57 |
+
</fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
</widget>
|
59 |
<advancedconfig module="livehelp" translate="label">
|
60 |
+
<label>Widget Configuration</label>
|
61 |
<frontend_type>text</frontend_type>
|
62 |
<sort_order>20</sort_order>
|
63 |
<show_in_default>1</show_in_default>
|
66 |
<depends>
|
67 |
<widget_method>2</widget_method>
|
68 |
</depends>
|
69 |
+
<comment>
|
70 |
+
<![CDATA[If you have set a list of dynamic widget in <a href="http://server.livehelp.it" target=blank>Livehelp® dashboard</a>, you can select one below]]>
|
71 |
+
</comment>
|
72 |
+
<fields>
|
73 |
+
<filter module="livehelp" translate="label comment">
|
74 |
<label>Choose a dynamic js widget</label>
|
75 |
<frontend_type>select</frontend_type>
|
76 |
<source_model>livehelp/config_source_GetCool</source_model>
|
77 |
+
<comment>
|
78 |
+
<![CDATA[The list of your widgets. <b>Click "Save Config"</b> if you don't see any widget.]]>
|
79 |
+
</comment>
|
80 |
<sort_order>1</sort_order>
|
81 |
<show_in_default>2</show_in_default>
|
82 |
<show_in_website>1</show_in_website>
|
83 |
<show_in_store>1</show_in_store>
|
84 |
</filter>
|
85 |
+
<cart module="livehelp" translate="label">
|
86 |
<label>Let agents view/edit cart details</label>
|
87 |
<frontend_type>select</frontend_type>
|
88 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
90 |
<show_in_default>1</show_in_default>
|
91 |
<show_in_website>1</show_in_website>
|
92 |
<show_in_store>1</show_in_store>
|
93 |
+
</cart>
|
94 |
+
<trackorder module="livehelp" translate="label">
|
95 |
<label>Track your orders</label>
|
96 |
<frontend_type>select</frontend_type>
|
97 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
98 |
+
<comment>
|
99 |
+
<![CDATA[Only for <b>business account</b>. ]]>
|
100 |
+
</comment>
|
101 |
<sort_order>3</sort_order>
|
102 |
<show_in_default>1</show_in_default>
|
103 |
<show_in_website>1</show_in_website>
|
104 |
<show_in_store>1</show_in_store>
|
105 |
+
</trackorder>
|
106 |
</fields>
|
107 |
+
</advancedconfig>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
</groups>
|
109 |
</livehelp>
|
110 |
</sections>
|
app/design/frontend/base/default/template/livehelp/widget.phtml
CHANGED
@@ -1,56 +1,34 @@
|
|
1 |
<?php
|
2 |
//get the page
|
3 |
$success= Mage::app()->getRequest()->getActionName();
|
4 |
-
|
5 |
-
//se � attivo
|
6 |
if ($this->isActive()){
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
$
|
22 |
-
}
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
}else{
|
28 |
-
//uso il nuovo metodo
|
29 |
-
if ($this->getDynamic()!="0"){
|
30 |
-
$MAGENTOcart="";
|
31 |
-
|
32 |
-
//vuole vedere cosa c'� nel carrello o l'id dell'utente se loggato
|
33 |
-
if ($this->getCart()!="0"){
|
34 |
-
$MAGENTOcart=$this->getCartLHInfo();
|
35 |
-
}
|
36 |
-
|
37 |
-
//voglio tracciare gli ordini conclusi grazie alla chat
|
38 |
-
if ($this->trackOrder()!="0"){
|
39 |
-
if ($success=="success"){
|
40 |
-
echo $this->trackCustomerOrder();
|
41 |
-
}
|
42 |
-
}?>
|
43 |
-
<!-- Start LiveHelp activation widget - http://www.livehelp.it -->
|
44 |
-
<script type="text/javascript">
|
45 |
-
var LHinfo='<?php echo $MAGENTOcart ?>';
|
46 |
function LHready(){if(document.readyState == "complete"){(function(){ var lh=document.createElement("script");
|
47 |
lh.type="text/javascript"; lh.async=true;
|
48 |
lh.src="//server.livehelp.it/widgetjs/<?php echo $this->getLivehelpID(); ?>/<?php echo $this->getDynamic(); ?>.js?x=" + 1*new Date();
|
49 |
var node=document.getElementsByTagName("script")[0];
|
50 |
node.parentNode.insertBefore(lh,node);
|
51 |
})();} else {setTimeout('LHready()',150);}} LHready();
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
}
|
56 |
}?>
|
1 |
<?php
|
2 |
//get the page
|
3 |
$success= Mage::app()->getRequest()->getActionName();
|
|
|
|
|
4 |
if ($this->isActive()){
|
5 |
+
|
6 |
+
$MAGENTOcart="";
|
7 |
+
|
8 |
+
//vuole vedere cosa c'� nel carrello o l'id dell'utente se loggato
|
9 |
+
if ($this->getCart()!="0")
|
10 |
+
{
|
11 |
+
$MAGENTOcart=Mage::getUrl()."livehelp/index/getcartlhinfo";
|
12 |
+
}
|
13 |
+
|
14 |
+
//voglio tracciare gli ordini conclusi grazie alla chat
|
15 |
+
if ($this->trackOrder()!="0")
|
16 |
+
{
|
17 |
+
if ($success=="success")
|
18 |
+
{
|
19 |
+
echo $this->trackCustomerOrder();
|
20 |
+
}
|
21 |
+
}?>
|
22 |
+
<!-- Start LiveHelp Magento activation widget - http://www.livehelp.it -->
|
23 |
+
<script type="text/javascript">
|
24 |
+
var LHmagento='<?php echo $MAGENTOcart ?>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
function LHready(){if(document.readyState == "complete"){(function(){ var lh=document.createElement("script");
|
26 |
lh.type="text/javascript"; lh.async=true;
|
27 |
lh.src="//server.livehelp.it/widgetjs/<?php echo $this->getLivehelpID(); ?>/<?php echo $this->getDynamic(); ?>.js?x=" + 1*new Date();
|
28 |
var node=document.getElementsByTagName("script")[0];
|
29 |
node.parentNode.insertBefore(lh,node);
|
30 |
})();} else {setTimeout('LHready()',150);}} LHready();
|
31 |
+
</script>
|
32 |
+
<?php
|
33 |
+
|
|
|
34 |
}?>
|
package.xml
CHANGED
@@ -1,20 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sostanza_LiveHelp</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
-
<license>OSL
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>Livehelp
|
10 |
<description>LiveHelp® is the customer care service in which the company operator answers to customers' and prospects' questions directly in a real-time chat.</description>
|
11 |
-
<notes>
|
12 |
-
|
13 |
-
|
14 |
-
<
|
15 |
-
<
|
16 |
-
<
|
17 |
-
<contents><target name="magecommunity"><dir name="Sostanza"><dir name="Livehelp"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Source"><file name="Buttons.php" hash="f451d7bd1d3407bde94d62e883e4ff03"/></dir></dir></dir><file name="Functions.php" hash="fd74d2fb46d84c5590e7e19ea1b7d6f0"/></dir><dir name="Helper"><file name="Data.php" hash="02dcb95a2e4f313a6441f1c0778bdbf1"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="GetCool.php" hash="6c5a81784a9850032c70877fd017dd42"/><file name="GetLivehelpButton.php" hash="51baf3c4be6be8e4e424325ab93313ba"/><file name="GetLivehelpPosition.php" hash="59393c3e30f5f94565eb581844f922d2"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f25d6bb4d60701e09a46780311123964"/><file name="config.xml" hash="e9c538003755e5d3aca16d66d7a516b3"/><file name="system.xml" hash="55e9cb6ae8cca1abd98ab131e56e1d29"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="livehelp"><file name="widget.phtml" hash="b1f6ee12f116787703c95ea4c47544fc"/></dir></dir><dir name="layout"><file name="livehelp.xml" hash="4cada04c2d968e0721a69c5287678889"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sostanza_Livehelp.xml" hash="e233123489b59007400da8a42e60b0fa"/></dir></target></contents>
|
18 |
<compatible/>
|
19 |
-
<dependencies><required><php><min>5.
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Sostanza_LiveHelp</name>
|
4 |
+
<version>1.6.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license>Open Software License (OSL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Livehelp live chat support</summary>
|
10 |
<description>LiveHelp® is the customer care service in which the company operator answers to customers' and prospects' questions directly in a real-time chat.</description>
|
11 |
+
<notes>New:
|
12 |
+
added server cache support</notes>
|
13 |
+
<authors><author><name>a.laciura@sostanza.it</name><user>alaciura</user><email>a.laciura@sostanza.it</email></author></authors>
|
14 |
+
<date>2016-05-30</date>
|
15 |
+
<time>10:57:48</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Sostanza"><dir name="Livehelp"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Source"><file name="Buttons.php" hash="f451d7bd1d3407bde94d62e883e4ff03"/></dir></dir></dir><file name="Functions.php" hash="99554b0ab65dd7ed4d9872b984261eb9"/></dir><dir name="Helper"><file name="Data.php" hash="350213592a87639adb3c550335b8bec6"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="GetCool.php" hash="f666d5f1002d594c30eea5fc870cfab8"/></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="58a140ee249b938f89600bd3196dee19"/></dir><dir name="etc"><file name="adminhtml.xml" hash="de3981ba2172cc18f178e9e55c71232b"/><file name="config.xml" hash="bad2cc6394a48384a27616b4963a03ed"/><file name="system.xml" hash="0c4a38c27159be9366f3c388449f5f09"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="livehelp.xml" hash="4cada04c2d968e0721a69c5287678889"/></dir><dir name="template"><dir name="livehelp"><file name="widget.phtml" hash="c13f4913c8291cc372575b27d4ea1cb1"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sostanza_Livehelp.xml" hash="e233123489b59007400da8a42e60b0fa"/></dir></target></contents>
|
|
|
17 |
<compatible/>
|
18 |
+
<dependencies><required><php><min>5.1.0</min><max>5.4.0</max></php></required></dependencies>
|
19 |
</package>
|