Version Notes
Now tracks checkout notifications and includes shopping cart contents, and which items were added or removed, in notifications. Moved most configuration into Olark.
Download this release
Release Info
| Developer | Olark Live Chat |
| Extension | Olark_Chatbox |
| Version | 1.0.7 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.6 to 1.0.7
- app/code/community/Olark/Chatbox/Block/Chatbox.php +120 -54
- app/code/community/Olark/Chatbox/Helper/Data.php +3 -1
- app/code/community/Olark/Chatbox/Model/Observer.php +43 -0
- app/code/community/Olark/Chatbox/etc/config.xml +166 -3
- app/code/community/Olark/Chatbox/etc/widget.xml +90 -91
- app/code/community/Olark/chatbox.tgz +0 -0
- package.xml +6 -8
app/code/community/Olark/Chatbox/Block/Chatbox.php
CHANGED
|
@@ -23,6 +23,28 @@ class Olark_Chatbox_Block_Chatbox
|
|
| 23 |
implements Mage_Widget_Block_Interface
|
| 24 |
{
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
/**
|
| 27 |
* Produces Olark Chatbox html
|
| 28 |
*
|
|
@@ -30,74 +52,118 @@ class Olark_Chatbox_Block_Chatbox
|
|
| 30 |
*/
|
| 31 |
protected function _toHtml()
|
| 32 |
{
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
$siteID = $this->getData('siteID');
|
| 38 |
if (empty($siteID)) {
|
| 39 |
return '';
|
| 40 |
}
|
| 41 |
-
|
| 42 |
-
//
|
| 43 |
$info = Mage::getSingleton('customer/session')->getCustomer();
|
| 44 |
if ($info) {
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
if ($items) {
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
);
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
}
|
| 75 |
}
|
| 76 |
|
| 77 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
$html = '
|
| 79 |
-
<!-- begin olark code
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
olark.identify
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
olark.
|
| 88 |
-
olark.configure(
|
| 89 |
-
olark.configure(
|
| 90 |
-
olark.configure(
|
| 91 |
-
olark.configure(
|
| 92 |
-
olark.configure(\'Magento.removeNotification\', '.json_encode(!!$this->getData('removeNotification')).');
|
| 93 |
-
olark.configure(\'Magento.addNotification\', '.json_encode(!!$this->getData('addNotification')).');
|
| 94 |
-
olark.configure(\'Magento.showSku\', '.json_encode(!!$this->getData('showSku')).');
|
| 95 |
-
olark.configure(\'Magento.version\', \'0.0.1\');
|
| 96 |
</script>
|
| 97 |
<!-- custom olark config -->
|
| 98 |
-
'.$this->getData('customConfig')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
|
| 100 |
return $html;
|
| 101 |
}
|
| 102 |
-
|
| 103 |
}
|
| 23 |
implements Mage_Widget_Block_Interface
|
| 24 |
{
|
| 25 |
|
| 26 |
+
/**
|
| 27 |
+
* Returns the version of this Olark CartSaver plugin.
|
| 28 |
+
*
|
| 29 |
+
* @return string
|
| 30 |
+
*/
|
| 31 |
+
protected function _getVersion() {
|
| 32 |
+
// http://www.magentron.com/blog/2011/07/20/how-to-display-your-extension-version-in-magento-admin
|
| 33 |
+
return Mage::getConfig()->getNode()->modules->Olark_Chatbox->version;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/**
|
| 37 |
+
* Pops the list of recent events. This empties the olark_chat_events list
|
| 38 |
+
* after returning the recent events.
|
| 39 |
+
*
|
| 40 |
+
* @return array
|
| 41 |
+
*/
|
| 42 |
+
protected function _popRecentEvents() {
|
| 43 |
+
// Passing `true` to getData() causes that data key to be cleared.
|
| 44 |
+
$session = Mage::getSingleton('core/session');
|
| 45 |
+
return $session->getData('olark_chatbox_events', true);
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
/**
|
| 49 |
* Produces Olark Chatbox html
|
| 50 |
*
|
| 52 |
*/
|
| 53 |
protected function _toHtml()
|
| 54 |
{
|
| 55 |
+
function formatPrice($value) {
|
| 56 |
+
return Mage::helper('core')->currency(
|
| 57 |
+
$value,
|
| 58 |
+
true, // Format the value for the localized currency.
|
| 59 |
+
false // Do not HTMLize the value.
|
| 60 |
+
);
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
$customer = array();
|
| 64 |
+
$products = array();
|
| 65 |
+
$totalValueOfItems = 0;
|
| 66 |
+
|
| 67 |
+
// Don't show the Olark code at all if there is no Site ID.
|
| 68 |
$siteID = $this->getData('siteID');
|
| 69 |
if (empty($siteID)) {
|
| 70 |
return '';
|
| 71 |
}
|
| 72 |
+
|
| 73 |
+
// Capture customer information for Olark config.
|
| 74 |
$info = Mage::getSingleton('customer/session')->getCustomer();
|
| 75 |
if ($info) {
|
| 76 |
+
|
| 77 |
+
$billingAddress = $info->getPrimaryBillingAddress();
|
| 78 |
+
if ($billingAddress) {
|
| 79 |
+
$billingAddress = $billingAddress->format('text');
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
$shippingAddress = $info->getPrimaryShippingAddress();
|
| 83 |
+
if ($shippingAddress) {
|
| 84 |
+
$shippingAddress = $shippingAddress->format('text');
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
$customer = array(
|
| 88 |
+
'name' => $info->getName(),
|
| 89 |
+
'email' => $info->getEmail(),
|
| 90 |
+
'billing_address' => $billingAddress,
|
| 91 |
+
'shipping_address' => $shippingAddress
|
| 92 |
+
);
|
| 93 |
+
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
// Capture cart information for Olark config.
|
| 97 |
+
$quote = Mage::getSingleton('checkout/session')->getQuote();
|
| 98 |
+
$items = $quote->getAllVisibleItems();
|
| 99 |
if ($items) {
|
| 100 |
+
$totalValueOfItems = 0;
|
| 101 |
+
foreach ($items as $item) {
|
| 102 |
+
|
| 103 |
+
// Capture the raw item in case we want to show
|
| 104 |
+
// more information in the future without updating
|
| 105 |
+
// our Magento app.
|
| 106 |
+
$magentoItem = $item->getData();
|
| 107 |
+
$magentoItem['formatted_price'] = formatPrice($item->getPrice());
|
| 108 |
+
|
| 109 |
+
$product = array(
|
| 110 |
+
'name' => $item->getName(),
|
| 111 |
+
'sku' => $item->getSku(),
|
| 112 |
+
'quantity' => $item->getQty(),
|
| 113 |
+
'price' => $item->getPrice(),
|
| 114 |
+
'magento' => $magentoItem
|
| 115 |
+
);
|
| 116 |
+
$products[] = $product;
|
| 117 |
+
$totalValueOfItems = $totalValueOfItems + ($product['price'] * $product['quantity']);
|
| 118 |
+
}
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
// Attempt to get totals from Magento directly.
|
| 122 |
+
$totals = $quote->getTotals();
|
| 123 |
+
foreach ($totals as $total) {
|
| 124 |
+
$name = $total->getCode();
|
| 125 |
+
$extraItems[] = array(
|
| 126 |
+
'name' => $name,
|
| 127 |
+
'price' => $total->getValue(),
|
| 128 |
+
'formatted_price' => formatPrice($total->getValue())
|
| 129 |
);
|
| 130 |
+
if ('subtotal' == $name) {
|
| 131 |
+
$totalValueOfItems = $total->getValue();
|
| 132 |
+
}
|
|
|
|
| 133 |
}
|
| 134 |
|
| 135 |
+
// Capture extra Magento-specific data for Olark config.
|
| 136 |
+
$magentoData = array(
|
| 137 |
+
'total' => $totalValueOfItems,
|
| 138 |
+
'formatted_total' => formatPrice($totalValueOfItems),
|
| 139 |
+
'extra_items' => $extraItems,
|
| 140 |
+
'recent_events' => $this->_popRecentEvents()
|
| 141 |
+
);
|
| 142 |
+
|
| 143 |
+
// Build and return HTML that represents the Olark embed and
|
| 144 |
+
// CartSaver-specific configuration.
|
| 145 |
$html = '
|
| 146 |
+
<!-- begin olark code -->
|
| 147 |
+
<script type="text/javascript">
|
| 148 |
+
window.olark||(function(c){var f=window,d=document,l=f.location.protocol=="https:"?"https:":"http:",z=c.name,r="load";var nt=function(){f[z]=function(){(a.s=a.s||[]).push(arguments)};var a=f[z]._={},q=c.methods.length;while(q--){(function(n){f[z][n]=function(){f[z]("call",n,arguments)}})(c.methods[q])}a.l=c.loader;a.i=nt;a.p={0:+new Date};a.P=function(u){a.p[u]=new Date-a.p[0]};function s(){a.P(r);f[z](r)}f.addEventListener?f.addEventListener(r,s,false):f.attachEvent("on"+r,s);var ld=function(){function p(hd){hd="head";return["<",hd,"></",hd,"><",i,\' onl\' + \'oad="var d=\',g,";d.getElementsByTagName(\'head\')[0].",j,"(d.",h,"(\'script\')).",k,"=\'",l,"//",a.l,"\'",\'"\',"></",i,">"].join("")}var i="body",m=d[i];if(!m){return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){b.src="javascript:false"}b.allowTransparency="true";v[j](b);try{b.contentWindow[g].open()}catch(w){c[e]=d[e];o="javascript:var d="+g+".open();d.domain=\'"+d.domain+"\';";b[k]=o+"void(0);"}try{var t=b.contentWindow[g];t.write(p());t.close()}catch(x){b[k]=o+\'d.write("\'+p().replace(/"/g,String.fromCharCode(92)+\'"\')+\'");d.close();\'}a.P(2)};ld()};nt()})({
|
| 149 |
+
loader: "static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]});
|
| 150 |
+
</script>
|
| 151 |
+
<noscript><a href="https://www.olark.com/site/'.$siteID.'/contact" title="Contact us" target="_blank">Questions? Feedback?</a> powered by <a href="http://www.olark.com?welcome" title="Olark live chat software">Olark live chat software</a></noscript>
|
| 152 |
+
<!-- olark magento cart saver -->
|
| 153 |
+
<script type="text/javascript">
|
| 154 |
+
olark.extend("CartSaver");
|
| 155 |
+
olark.configure("CartSaver.version", "Magento@'.$this->_getVersion().'");
|
| 156 |
+
olark.configure("CartSaver.customer", '.json_encode($customer).');
|
| 157 |
+
olark.configure("CartSaver.items", '.json_encode($products).');
|
| 158 |
+
olark.configure("CartSaver.magento", '.json_encode($magentoData).');
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
</script>
|
| 160 |
<!-- custom olark config -->
|
| 161 |
+
'.$this->getData('customConfig').'
|
| 162 |
+
<script>
|
| 163 |
+
olark.identify("'.$siteID.'");
|
| 164 |
+
</script>
|
| 165 |
+
';
|
| 166 |
|
| 167 |
return $html;
|
| 168 |
}
|
|
|
|
| 169 |
}
|
app/code/community/Olark/Chatbox/Helper/Data.php
CHANGED
|
@@ -20,5 +20,7 @@
|
|
| 20 |
|
| 21 |
class Olark_Chatbox_Helper_Data extends Mage_Core_Helper_Abstract
|
| 22 |
{
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
}
|
| 20 |
|
| 21 |
class Olark_Chatbox_Helper_Data extends Mage_Core_Helper_Abstract
|
| 22 |
{
|
| 23 |
+
// THIS EMPTY FILE IS REQUIRED! Magento uses it for the Admin.
|
| 24 |
+
// It is related to "Olark_Chatbox_Helper" in config.xml
|
| 25 |
+
// http://stackoverflow.com/a/7242531
|
| 26 |
}
|
app/code/community/Olark/Chatbox/Model/Observer.php
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Widget that adds Olark Live Chat to Magento stores.
|
| 4 |
+
*
|
| 5 |
+
* NOTICE OF LICENSE
|
| 6 |
+
*
|
| 7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
| 8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
| 9 |
+
* It is also available through the world-wide-web at this URL:
|
| 10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
| 11 |
+
* If you did not receive a copy of the license and are unable to
|
| 12 |
+
* obtain it through the world-wide-web, please send an email
|
| 13 |
+
* to support@olark.com so we can send you a copy immediately.
|
| 14 |
+
*
|
| 15 |
+
* @category Olark
|
| 16 |
+
* @package Olark_Chatbox
|
| 17 |
+
* @copyright Copyright 2012. Habla, Inc. (http://www.olark.com)
|
| 18 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
// See ../etc/config.xml for observer configuration.
|
| 22 |
+
// List of events: http://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/
|
| 23 |
+
class Olark_Chatbox_Model_Observer
|
| 24 |
+
{
|
| 25 |
+
|
| 26 |
+
public function recordEvent($observer) {
|
| 27 |
+
|
| 28 |
+
// Get a list of the events
|
| 29 |
+
$session = Mage::getSingleton('core/session');
|
| 30 |
+
$events = $session->getData('olark_chatbox_events');
|
| 31 |
+
|
| 32 |
+
// Append to this list. Add a timestamp so we know the
|
| 33 |
+
// relative times that the events happened.
|
| 34 |
+
$events[] = array(
|
| 35 |
+
'type' => $observer->getEvent()->getName(),
|
| 36 |
+
'timestamp' => time()
|
| 37 |
+
);
|
| 38 |
+
|
| 39 |
+
$session->setData('olark_chatbox_events', $events);
|
| 40 |
+
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
}
|
app/code/community/Olark/Chatbox/etc/config.xml
CHANGED
|
@@ -22,7 +22,7 @@
|
|
| 22 |
<config>
|
| 23 |
<modules>
|
| 24 |
<Olark_Chatbox>
|
| 25 |
-
<version>1.0.
|
| 26 |
<cache_lifetime>0</cache_lifetime>
|
| 27 |
</Olark_Chatbox>
|
| 28 |
</modules>
|
|
@@ -33,9 +33,172 @@
|
|
| 33 |
</chatbox>
|
| 34 |
</helpers>
|
| 35 |
<blocks>
|
| 36 |
-
|
| 37 |
<class>Olark_Chatbox_Block</class>
|
| 38 |
-
|
| 39 |
</blocks>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
</global>
|
| 41 |
</config>
|
| 22 |
<config>
|
| 23 |
<modules>
|
| 24 |
<Olark_Chatbox>
|
| 25 |
+
<version>1.0.7</version>
|
| 26 |
<cache_lifetime>0</cache_lifetime>
|
| 27 |
</Olark_Chatbox>
|
| 28 |
</modules>
|
| 33 |
</chatbox>
|
| 34 |
</helpers>
|
| 35 |
<blocks>
|
| 36 |
+
<chatbox>
|
| 37 |
<class>Olark_Chatbox_Block</class>
|
| 38 |
+
</chatbox>
|
| 39 |
</blocks>
|
| 40 |
+
<events>
|
| 41 |
+
|
| 42 |
+
<checkout_quote_destroy>
|
| 43 |
+
<observers>
|
| 44 |
+
<olark_chatbox_checkout_quote_destroy>
|
| 45 |
+
<type>singleton</type>
|
| 46 |
+
<class>olark_chatbox_model_observer</class>
|
| 47 |
+
<method>recordEvent</method>
|
| 48 |
+
</olark_chatbox_checkout_quote_destroy>
|
| 49 |
+
</observers>
|
| 50 |
+
</checkout_quote_destroy>
|
| 51 |
+
|
| 52 |
+
<controller_action_predispatch_checkout_onepage_index>
|
| 53 |
+
<observers>
|
| 54 |
+
<olark_chatbox_controller_action_predispatch_checkout_onepage_index>
|
| 55 |
+
<type>singleton</type>
|
| 56 |
+
<class>olark_chatbox_model_observer</class>
|
| 57 |
+
<method>recordEvent</method>
|
| 58 |
+
</olark_chatbox_controller_action_predispatch_checkout_onepage_index>
|
| 59 |
+
</observers>
|
| 60 |
+
</controller_action_predispatch_checkout_onepage_index>
|
| 61 |
+
|
| 62 |
+
<controller_action_predispatch_checkout_multishipping_index>
|
| 63 |
+
<observers>
|
| 64 |
+
<olark_chatbox_controller_action_predispatch_checkout_multishipping_index>
|
| 65 |
+
<type>singleton</type>
|
| 66 |
+
<class>olark_chatbox_model_observer</class>
|
| 67 |
+
<method>recordEvent</method>
|
| 68 |
+
</olark_chatbox_controller_action_predispatch_checkout_multishipping_index>
|
| 69 |
+
</observers>
|
| 70 |
+
</controller_action_predispatch_checkout_multishipping_index>
|
| 71 |
+
|
| 72 |
+
<controller_action_predispatch_checkout_controller_action_index>
|
| 73 |
+
<observers>
|
| 74 |
+
<olark_chatbox_controller_action_predispatch_checkout_controller_action_index>
|
| 75 |
+
<type>singleton</type>
|
| 76 |
+
<class>olark_chatbox_model_observer</class>
|
| 77 |
+
<method>recordEvent</method>
|
| 78 |
+
</olark_chatbox_controller_action_predispatch_checkout_controller_action_index>
|
| 79 |
+
</observers>
|
| 80 |
+
</controller_action_predispatch_checkout_controller_action_index>
|
| 81 |
+
|
| 82 |
+
<googlecheckout_checkout_before>
|
| 83 |
+
<observers>
|
| 84 |
+
<olark_chatbox_googlecheckout_checkout_before>
|
| 85 |
+
<type>singleton</type>
|
| 86 |
+
<class>olark_chatbox_model_observer</class>
|
| 87 |
+
<method>recordEvent</method>
|
| 88 |
+
</olark_chatbox_googlecheckout_checkout_before>
|
| 89 |
+
</observers>
|
| 90 |
+
</googlecheckout_checkout_before>
|
| 91 |
+
|
| 92 |
+
<paypal_prepare_line_items>
|
| 93 |
+
<observers>
|
| 94 |
+
<olark_chatbox_paypal_prepare_line_items>
|
| 95 |
+
<type>singleton</type>
|
| 96 |
+
<class>olark_chatbox_model_observer</class>
|
| 97 |
+
<method>recordEvent</method>
|
| 98 |
+
</olark_chatbox_paypal_prepare_line_items>
|
| 99 |
+
</observers>
|
| 100 |
+
</paypal_prepare_line_items>
|
| 101 |
+
|
| 102 |
+
<sales_order_place_after>
|
| 103 |
+
<observers>
|
| 104 |
+
<olark_chatbox_sales_order_place_after>
|
| 105 |
+
<type>singleton</type>
|
| 106 |
+
<class>olark_chatbox_model_observer</class>
|
| 107 |
+
<method>recordEvent</method>
|
| 108 |
+
</olark_chatbox_sales_order_place_after>
|
| 109 |
+
</observers>
|
| 110 |
+
</sales_order_place_after>
|
| 111 |
+
|
| 112 |
+
<checkout_submit_all_after>
|
| 113 |
+
<observers>
|
| 114 |
+
<olark_chatbox_checkout_submit_all_after>
|
| 115 |
+
<type>singleton</type>
|
| 116 |
+
<class>olark_chatbox_model_observer</class>
|
| 117 |
+
<method>recordEvent</method>
|
| 118 |
+
</olark_chatbox_checkout_submit_all_after>
|
| 119 |
+
</observers>
|
| 120 |
+
</checkout_submit_all_after>
|
| 121 |
+
|
| 122 |
+
<sales_order_payment_cancel>
|
| 123 |
+
<observers>
|
| 124 |
+
<olark_chatbox_sales_order_payment_cancel>
|
| 125 |
+
<type>singleton</type>
|
| 126 |
+
<class>olark_chatbox_model_observer</class>
|
| 127 |
+
<method>recordEvent</method>
|
| 128 |
+
</olark_chatbox_sales_order_payment_cancel>
|
| 129 |
+
</observers>
|
| 130 |
+
</sales_order_payment_cancel>
|
| 131 |
+
|
| 132 |
+
<order_cancel_after>
|
| 133 |
+
<observers>
|
| 134 |
+
<olark_chatbox_order_cancel_after>
|
| 135 |
+
<type>singleton</type>
|
| 136 |
+
<class>olark_chatbox_model_observer</class>
|
| 137 |
+
<method>recordEvent</method>
|
| 138 |
+
</olark_chatbox_order_cancel_after>
|
| 139 |
+
</observers>
|
| 140 |
+
</order_cancel_after>
|
| 141 |
+
|
| 142 |
+
<sales_order_payment_cancel_invoice>
|
| 143 |
+
<observers>
|
| 144 |
+
<olark_chatbox_sales_order_payment_cancel_invoice>
|
| 145 |
+
<type>singleton</type>
|
| 146 |
+
<class>olark_chatbox_model_observer</class>
|
| 147 |
+
<method>recordEvent</method>
|
| 148 |
+
</olark_chatbox_sales_order_payment_cancel_invoice>
|
| 149 |
+
</observers>
|
| 150 |
+
</sales_order_payment_cancel_invoice>
|
| 151 |
+
|
| 152 |
+
<sales_order_payment_void>
|
| 153 |
+
<observers>
|
| 154 |
+
<olark_chatbox_sales_order_payment_void>
|
| 155 |
+
<type>singleton</type>
|
| 156 |
+
<class>olark_chatbox_model_observer</class>
|
| 157 |
+
<method>recordEvent</method>
|
| 158 |
+
</olark_chatbox_sales_order_payment_void>
|
| 159 |
+
</observers>
|
| 160 |
+
</sales_order_payment_void>
|
| 161 |
+
|
| 162 |
+
<sales_order_payment_refund>
|
| 163 |
+
<observers>
|
| 164 |
+
<olark_chatbox_sales_order_payment_refund>
|
| 165 |
+
<type>singleton</type>
|
| 166 |
+
<class>olark_chatbox_model_observer</class>
|
| 167 |
+
<method>recordEvent</method>
|
| 168 |
+
</olark_chatbox_sales_order_payment_refund>
|
| 169 |
+
</observers>
|
| 170 |
+
</sales_order_payment_refund>
|
| 171 |
+
|
| 172 |
+
<sales_order_payment_cancel>
|
| 173 |
+
<observers>
|
| 174 |
+
<olark_chatbox_sales_order_payment_cancel>
|
| 175 |
+
<type>singleton</type>
|
| 176 |
+
<class>olark_chatbox_model_observer</class>
|
| 177 |
+
<method>recordEvent</method>
|
| 178 |
+
</olark_chatbox_sales_order_payment_cancel>
|
| 179 |
+
</observers>
|
| 180 |
+
</sales_order_payment_cancel>
|
| 181 |
+
|
| 182 |
+
<sales_order_invoice_cancel>
|
| 183 |
+
<observers>
|
| 184 |
+
<olark_chatbox_sales_order_invoice_cancel>
|
| 185 |
+
<type>singleton</type>
|
| 186 |
+
<class>olark_chatbox_model_observer</class>
|
| 187 |
+
<method>recordEvent</method>
|
| 188 |
+
</olark_chatbox_sales_order_invoice_cancel>
|
| 189 |
+
</observers>
|
| 190 |
+
</sales_order_invoice_cancel>
|
| 191 |
+
|
| 192 |
+
<sales_order_item_cancel>
|
| 193 |
+
<observers>
|
| 194 |
+
<olark_chatbox_sales_order_item_cancel>
|
| 195 |
+
<type>singleton</type>
|
| 196 |
+
<class>olark_chatbox_model_observer</class>
|
| 197 |
+
<method>recordEvent</method>
|
| 198 |
+
</olark_chatbox_sales_order_item_cancel>
|
| 199 |
+
</observers>
|
| 200 |
+
</sales_order_item_cancel>
|
| 201 |
+
|
| 202 |
+
</events>
|
| 203 |
</global>
|
| 204 |
</config>
|
app/code/community/Olark/Chatbox/etc/widget.xml
CHANGED
|
@@ -20,109 +20,108 @@
|
|
| 20 |
*/
|
| 21 |
-->
|
| 22 |
<widgets>
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
<parameters>
|
| 27 |
<siteID>
|
| 28 |
<label>Olark Site-ID</label>
|
| 29 |
<visible>1</visible>
|
| 30 |
<required>1</required>
|
| 31 |
<type>text</type>
|
| 32 |
-
<description
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
</siteID>
|
| 41 |
-
<valueThreshold>
|
| 42 |
-
<label>Minimum Cart Value for Notifications</label>
|
| 43 |
-
<visible>1</visible>
|
| 44 |
-
<required>0</required>
|
| 45 |
-
<type>text</type>
|
| 46 |
-
<description>
|
| 47 |
-
<![CDATA[
|
| 48 |
-
Send a notification to your operator when a customer's cart reaches at least this value.
|
| 49 |
-
]]>
|
| 50 |
-
</description>
|
| 51 |
-
</valueThreshold>
|
| 52 |
-
<addNotification>
|
| 53 |
-
<label>Send Cart Add Notifications?</label>
|
| 54 |
-
<visible>1</visible>
|
| 55 |
-
<required>0</required>
|
| 56 |
-
<type>select</type>
|
| 57 |
-
<values>
|
| 58 |
-
<one translate="label">
|
| 59 |
-
<value>1</value>
|
| 60 |
-
<label>Yes</label>
|
| 61 |
-
</one>
|
| 62 |
-
<two translate="label">
|
| 63 |
-
<value>0</value>
|
| 64 |
-
<label>No</label>
|
| 65 |
-
</two>
|
| 66 |
-
</values>
|
| 67 |
-
<description>
|
| 68 |
-
<![CDATA[
|
| 69 |
-
Turn on or off notifications to your operator when a product is added from a customer's cart.
|
| 70 |
-
]]>
|
| 71 |
-
</description>
|
| 72 |
-
</addNotification>
|
| 73 |
-
<removeNotification>
|
| 74 |
-
<label>Send Cart Removal Notifications?</label>
|
| 75 |
-
<visible>1</visible>
|
| 76 |
-
<required>0</required>
|
| 77 |
-
<type>select</type>
|
| 78 |
-
<values>
|
| 79 |
-
<one translate="label">
|
| 80 |
-
<value>1</value>
|
| 81 |
-
<label>Yes</label>
|
| 82 |
-
</one>
|
| 83 |
-
<two translate="label">
|
| 84 |
-
<value>0</value>
|
| 85 |
-
<label>No</label>
|
| 86 |
-
</two>
|
| 87 |
-
</values>
|
| 88 |
-
<description>
|
| 89 |
-
<![CDATA[
|
| 90 |
-
Turn on or off notifications to your operator when a product is removed from a customers cart.
|
| 91 |
-
]]>
|
| 92 |
-
</description>
|
| 93 |
-
</removeNotification>
|
| 94 |
-
<showSku>
|
| 95 |
-
<label>Show SKU?</label>
|
| 96 |
-
<visible>1</visible>
|
| 97 |
-
<required>0</required>
|
| 98 |
-
<type>select</type>
|
| 99 |
-
<values>
|
| 100 |
-
<one translate="label">
|
| 101 |
-
<value>1</value>
|
| 102 |
-
<label>Yes</label>
|
| 103 |
-
</one>
|
| 104 |
-
<two translate="label">
|
| 105 |
-
<value>0</value>
|
| 106 |
-
<label>No</label>
|
| 107 |
-
</two>
|
| 108 |
-
</values>
|
| 109 |
-
<description>
|
| 110 |
-
<![CDATA[
|
| 111 |
-
Show the SKU as part of the product name in the operator's buddy list.
|
| 112 |
-
]]>
|
| 113 |
-
</description>
|
| 114 |
-
</showSku>
|
| 115 |
<customConfig>
|
| 116 |
<label>Developer API snippets</label>
|
| 117 |
<visible>1</visible>
|
| 118 |
<required>0</required>
|
| 119 |
<type>textarea</type>
|
| 120 |
-
<description
|
| 121 |
-
<![CDATA[
|
| 122 |
-
For help on how to use the API and for example snippets, go to <a target="_blank" href="http://olark.com/developer">http://olark.com/developer</a>
|
| 123 |
-
]]>
|
| 124 |
-
</description>
|
| 125 |
</customConfig>
|
| 126 |
</parameters>
|
| 127 |
-
|
| 128 |
</widgets>
|
| 20 |
*/
|
| 21 |
-->
|
| 22 |
<widgets>
|
| 23 |
+
<chatbox_chatbox type="chatbox/chatbox" translate="name description" module="chatbox">
|
| 24 |
+
<name>Olark Live Chat</name>
|
| 25 |
+
<description>Adds Olark Live Chat to your website.</description>
|
| 26 |
<parameters>
|
| 27 |
<siteID>
|
| 28 |
<label>Olark Site-ID</label>
|
| 29 |
<visible>1</visible>
|
| 30 |
<required>1</required>
|
| 31 |
<type>text</type>
|
| 32 |
+
<description><![CDATA[
|
| 33 |
+
<h3 style="margin-top:1em;font-size:1.5em">
|
| 34 |
+
Get started in 5 minutes.
|
| 35 |
+
</h3>
|
| 36 |
+
<ol style="list-style: decimal; margin-left: 30px; font-size: 1.5em; line-height: 1.5em;">
|
| 37 |
+
<li>
|
| 38 |
+
<a target="_blank" href="https://olark.com/signup/create_new_account?cartsaver=magento&version=1.0.7&rid=magento-connect">
|
| 39 |
+
Create an Olark account</a>
|
| 40 |
+
if you don't have one.
|
| 41 |
+
</li>
|
| 42 |
+
<li>
|
| 43 |
+
<a target="_blank" href="https://olark.com/settings/site-id?cartsaver=magento&version=1.0.7&rid=magento-connect">
|
| 44 |
+
Find your Site ID</a>
|
| 45 |
+
and type it above.
|
| 46 |
+
</li>
|
| 47 |
+
<li>
|
| 48 |
+
<a target="_blank" href="https://olark.com/extensions/cartsaver?cartsaver=magento&version=1.0.7&rid=magento-connect">
|
| 49 |
+
Configure CartSaver notifications</a>
|
| 50 |
+
in your Olark account.
|
| 51 |
+
</li>
|
| 52 |
+
<li>
|
| 53 |
+
<a target="_blank" href="https://chat.olark.com/?cartsaver=magento&version=1.0.7&rid=magento-connect">
|
| 54 |
+
Start chatting with your customers.</a>
|
| 55 |
+
That's it!
|
| 56 |
+
</li>
|
| 57 |
+
</ol>
|
| 58 |
+
|
| 59 |
+
<p style="margin-top: 1em">
|
| 60 |
+
<strong>Need help?</strong> You can
|
| 61 |
+
<a target="_blank" href="http://olark.com/help/magento-connect?cartsaver=magento&version=1.0.7&rid=magento-connect">
|
| 62 |
+
read our tutorial</a>,
|
| 63 |
+
or contact us by
|
| 64 |
+
<a target="_blank" href="http://olark.com/help/magento-connect?cartsaver=magento&version=1.0.7&intent=chat&rid=magento-connect">
|
| 65 |
+
live chat</a>
|
| 66 |
+
or
|
| 67 |
+
<a target="_blank" href="mailto:support+magento@olark.com">
|
| 68 |
+
email</a>.
|
| 69 |
+
</p>
|
| 70 |
+
|
| 71 |
+
<hr style="border: none; border: solid #ccc 1px; margin: 3em 0 3em 0;"/>
|
| 72 |
+
|
| 73 |
+
<h3>
|
| 74 |
+
Save the sale with Olark CartSaver for Magento!
|
| 75 |
+
</h3>
|
| 76 |
+
|
| 77 |
+
<p style="margin-top: 1em">
|
| 78 |
+
Olark lets you answer questions immediately,
|
| 79 |
+
keep customers browsing your store and save the sale!
|
| 80 |
+
</p>
|
| 81 |
+
|
| 82 |
+
<p style="margin-top: 1em"><strong>See what customers do on your Magento store.</strong> You'll know
|
| 83 |
+
the second customers want to buy when Olark
|
| 84 |
+
CartSaver notifies you in real-time whenever customers
|
| 85 |
+
update their cart, proceed to checkout, and complete the sale.
|
| 86 |
+
Then reach out and help. You'll keep your customers interested
|
| 87 |
+
all the way to purchase.
|
| 88 |
+
</p>
|
| 89 |
+
|
| 90 |
+
<p style="margin-top: 1em">
|
| 91 |
+
<strong><a target="_blank" href="http://olark.com/redirect/magento-connect?cartsaver=magento&version=1.0.7&rid=magento-connect">
|
| 92 |
+
|
| 93 |
+
Learn more and give us a good review in Magento Connect</a></strong>
|
| 94 |
+
</p>
|
| 95 |
+
|
| 96 |
+
<hr style="border: none; border: solid #ccc 1px; margin: 3em 0 3em 0;"/>
|
| 97 |
+
|
| 98 |
+
<h3>
|
| 99 |
+
Advanced: Developer API snippets
|
| 100 |
+
</h3>
|
| 101 |
+
|
| 102 |
+
<p style="margin-top: 1em">
|
| 103 |
+
Olark has an extensive Javascript API which developers
|
| 104 |
+
can use to change the behavior of how Olark works.
|
| 105 |
+
<a target="_blank" href="http://olark.com/documentation?cartsaver=magento&version=1.0.7&rid=magento-connect">
|
| 106 |
+
Read our documentation for more information</a>.</p>
|
| 107 |
+
|
| 108 |
+
<p style="margin-top: 1em">To include your own HTML or Javascript, just paste it below. Please <a target="_blank" href="mailto:support+magento@olark.com">get in touch</a> if you run into any problems.</p>
|
| 109 |
+
|
| 110 |
+
<p style="margin-top: 1em">
|
| 111 |
+
<strong>
|
| 112 |
+
Don't forget to wrap your
|
| 113 |
+
Javascript in <script></script> tags!
|
| 114 |
+
</strong>
|
| 115 |
+
</p>
|
| 116 |
+
]]></description>
|
| 117 |
</siteID>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
<customConfig>
|
| 119 |
<label>Developer API snippets</label>
|
| 120 |
<visible>1</visible>
|
| 121 |
<required>0</required>
|
| 122 |
<type>textarea</type>
|
| 123 |
+
<description/>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
</customConfig>
|
| 125 |
</parameters>
|
| 126 |
+
</chatbox_chatbox>
|
| 127 |
</widgets>
|
app/code/community/Olark/chatbox.tgz
ADDED
|
Binary file
|
package.xml
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Olark_Chatbox</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/afl-3.0.php">Academic Free License (AFL 3.0)</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
-
<summary>
|
| 10 |
<description>Be your customers' hero. Nothing answers customers or saves the sale faster than Olark live chat.
|
| 11 |

|
| 12 |
With CartSaver for Magento, see in real-time exactly what your customer do on your Magento store and then take action. End abandoned shopping carts.
|
|
@@ -14,13 +14,11 @@ With CartSaver for Magento, see in real-time exactly what your customer do on yo
|
|
| 14 |
Be their favorite salesperson as you can follow along as your customers add and remove items from their shopping carts, so you can talk to them about what they are buying.
|
| 15 |

|
| 16 |
Over 5,000 customers rely on Olark to make their customers happier and buying more.</description>
|
| 17 |
-
<notes>
|
| 18 |
-

|
| 19 |
-
Made widget help text slightly clearer.</notes>
|
| 20 |
<authors><author><name>Olark Live Chat</name><user>olark</user><email>support@olark.com</email></author></authors>
|
| 21 |
-
<date>2013-03-
|
| 22 |
-
<time>
|
| 23 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Olark_Chatbox.xml" hash="220e124817be0b67876250efca078b83"/></dir></target><target name="magecommunity"><dir name="Olark"><dir name="Chatbox"><dir name="Block"><file name="Chatbox.php" hash="
|
| 24 |
<compatible/>
|
| 25 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 26 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Olark_Chatbox</name>
|
| 4 |
+
<version>1.0.7</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/afl-3.0.php">Academic Free License (AFL 3.0)</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
+
<summary>Olark Live Chat with CartSaver for Magento</summary>
|
| 10 |
<description>Be your customers' hero. Nothing answers customers or saves the sale faster than Olark live chat.
|
| 11 |

|
| 12 |
With CartSaver for Magento, see in real-time exactly what your customer do on your Magento store and then take action. End abandoned shopping carts.
|
| 14 |
Be their favorite salesperson as you can follow along as your customers add and remove items from their shopping carts, so you can talk to them about what they are buying.
|
| 15 |

|
| 16 |
Over 5,000 customers rely on Olark to make their customers happier and buying more.</description>
|
| 17 |
+
<notes>Now tracks checkout notifications and includes shopping cart contents, and which items were added or removed, in notifications. Moved most configuration into Olark.</notes>
|
|
|
|
|
|
|
| 18 |
<authors><author><name>Olark Live Chat</name><user>olark</user><email>support@olark.com</email></author></authors>
|
| 19 |
+
<date>2013-03-25</date>
|
| 20 |
+
<time>19:11:16</time>
|
| 21 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Olark_Chatbox.xml" hash="220e124817be0b67876250efca078b83"/></dir></target><target name="magecommunity"><dir name="Olark"><dir name="Chatbox"><dir name="Block"><file name="Chatbox.php" hash="a44a578626222819adf81f075e504abb"/></dir><dir name="Helper"><file name="Data.php" hash="6d1e1005a4c4f22ccdd7af419a2ed28a"/></dir><dir name="Model"><file name="Observer.php" hash="e179b730ccc182588dc819d4a44355ba"/></dir><dir name="etc"><file name="config.xml" hash="9bae160df00092eb9e998f256b1c027b"/><file name="widget.xml" hash="e0dd79dcf207489b3067b256b7000377"/></dir></dir><file name="chatbox.tgz" hash="4db60165ce34a97c22bd245186b96e10"/></dir></target></contents>
|
| 22 |
<compatible/>
|
| 23 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 24 |
</package>
|
