Version Notes
- Improved cart tracking
Download this release
Release Info
Developer | Maxime Pruvost |
Extension | cartsguru |
Version | 1.2.15 |
Comparing to | |
See all releases |
Code changes from version 1.2.14 to 1.2.15
app/code/local/Cartsguru/Model/Webservice.php
CHANGED
@@ -151,7 +151,16 @@ class Cartsguru_Model_Webservice
|
|
151 |
$image = Mage::helper('catalog/image')->init($product, 'small_image');
|
152 |
}
|
153 |
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
}
|
156 |
|
157 |
/**
|
151 |
$image = Mage::helper('catalog/image')->init($product, 'small_image');
|
152 |
}
|
153 |
|
154 |
+
//Get the url
|
155 |
+
$image = (string)$image;
|
156 |
+
|
157 |
+
//Work with the normal image if no small image available
|
158 |
+
if (empty($image)){
|
159 |
+
$image = Mage::helper('catalog/image')->init($product, 'image');
|
160 |
+
$image = (string)$image;
|
161 |
+
}
|
162 |
+
|
163 |
+
return $image;
|
164 |
}
|
165 |
|
166 |
/**
|
app/code/local/Cartsguru/controllers/SaveaccountController.php
CHANGED
@@ -13,8 +13,8 @@ class Cartsguru_SaveaccountController extends Mage_Core_Controller_Front_Action
|
|
13 |
// Post the data
|
14 |
$quote = Mage::getModel('checkout/cart')->getQuote();
|
15 |
$quote->setCustomerEmail($params['email']);
|
16 |
-
if (isset($params['
|
17 |
-
$quote->setCustomerFirstname($params['
|
18 |
}
|
19 |
if (isset($params['lastname'])){
|
20 |
$quote->setCustomerLastname($params['lastname']);
|
13 |
// Post the data
|
14 |
$quote = Mage::getModel('checkout/cart')->getQuote();
|
15 |
$quote->setCustomerEmail($params['email']);
|
16 |
+
if (isset($params['firstname'])){
|
17 |
+
$quote->setCustomerFirstname($params['firstname']);
|
18 |
}
|
19 |
if (isset($params['lastname'])){
|
20 |
$quote->setCustomerLastname($params['lastname']);
|
app/design/frontend/base/default/layout/cartsguru.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<layout version="1.0.0">
|
3 |
+
<default translate="label">
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addJs"><script>cartsguru/checkout.js</script></action>
|
6 |
+
</reference>
|
7 |
+
</default>
|
8 |
+
</layout>
|
js/cartsguru/checkout.js
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function(document) {
|
2 |
+
document.addEventListener('DOMContentLoaded', setupTracking);
|
3 |
+
|
4 |
+
var fields = {
|
5 |
+
firstname: 'billing:firstname',
|
6 |
+
lastname: 'billing:lastname',
|
7 |
+
telephone: 'billing:telephone',
|
8 |
+
email: 'billing:email',
|
9 |
+
country: 'billing:country_id'
|
10 |
+
};
|
11 |
+
|
12 |
+
function setupTracking () {
|
13 |
+
for (var item in fields) {
|
14 |
+
if (fields.hasOwnProperty(item)) {
|
15 |
+
if (Array.isArray(fields[item])) {
|
16 |
+
for (var i = 0; i < fields[item].length; i++) {
|
17 |
+
var el = document.getElementById(fields[item][i]);
|
18 |
+
if (el) {
|
19 |
+
fields[item] = el;
|
20 |
+
break;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
} else {
|
24 |
+
fields[item] = document.getElementById(fields[item]);
|
25 |
+
}
|
26 |
+
}
|
27 |
+
}
|
28 |
+
if (fields.email && fields.firstname) {
|
29 |
+
for (item in fields) {
|
30 |
+
if (fields.hasOwnProperty(item)) {
|
31 |
+
fields[item].addEventListener('blur', trackData);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
function collectData () {
|
38 |
+
var data = [];
|
39 |
+
for (var item in fields) {
|
40 |
+
if (fields.hasOwnProperty(item)) {
|
41 |
+
if (item === 'email' && fields[item].value === '') {
|
42 |
+
return false;
|
43 |
+
}
|
44 |
+
if (item === 'country') {
|
45 |
+
data.push((encodeURIComponent(item) + "=" + encodeURIComponent(fields[item].options[fields[item].selectedIndex].value)));
|
46 |
+
} else {
|
47 |
+
data.push((encodeURIComponent(item) + "=" + encodeURIComponent(fields[item].value)));
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
51 |
+
return data;
|
52 |
+
}
|
53 |
+
|
54 |
+
function trackData () {
|
55 |
+
var data = collectData();
|
56 |
+
if (data) {
|
57 |
+
xhr = new XMLHttpRequest();
|
58 |
+
xhr.open('POST', '/cartsguru/saveaccount', true);
|
59 |
+
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
60 |
+
xhr.send(data.join("&"));
|
61 |
+
}
|
62 |
+
}
|
63 |
+
})(document);
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>cartsguru</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
<channel>community</channel>
|
@@ -16,12 +16,11 @@ Effortlessly reduce the number of abandoned shopping carts by automating telepho
|
|
16 |

|
17 |
- SMS Callback & Push SMS
|
18 |
Send to your prospective customers having abandoned a cart, an SMS suggesting a free call back from your customer relations service, a straightforward SMS reminder or an SMS offering a personalized discount</description>
|
19 |
-
<notes>-
|
20 |
-
- Improve performance</notes>
|
21 |
<authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
|
22 |
-
<date>2016-11-
|
23 |
-
<time>
|
24 |
-
<contents><target name="magelocal"><dir name="Cartsguru"><dir name="Helper"><file name="Data.php" hash="f6590d08ba862a169ce43459ddb1193c"/><file name="Tools.php" hash="612133db113c08e7de7ab94a86d23e34"/></dir><dir name="Model"><file name="Observer.php" hash="93ad478de9ac40d76c65dd1054d9f5a5"/><file name="Webservice.php" hash="
|
25 |
<compatible/>
|
26 |
<dependencies><required><php><min>5.3.0</min><max>7.1.0</max></php></required></dependencies>
|
27 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>cartsguru</name>
|
4 |
+
<version>1.2.15</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
<channel>community</channel>
|
16 |

|
17 |
- SMS Callback & Push SMS
|
18 |
Send to your prospective customers having abandoned a cart, an SMS suggesting a free call back from your customer relations service, a straightforward SMS reminder or an SMS offering a personalized discount</description>
|
19 |
+
<notes>- Improved cart tracking</notes>
|
|
|
20 |
<authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
|
21 |
+
<date>2016-11-15</date>
|
22 |
+
<time>15:58:09</time>
|
23 |
+
<contents><target name="magelocal"><dir name="Cartsguru"><dir name="Helper"><file name="Data.php" hash="f6590d08ba862a169ce43459ddb1193c"/><file name="Tools.php" hash="612133db113c08e7de7ab94a86d23e34"/></dir><dir name="Model"><file name="Observer.php" hash="93ad478de9ac40d76c65dd1054d9f5a5"/><file name="Webservice.php" hash="2eb173e8dee65ddf308d08bcd6e2eee2"/></dir><dir name="controllers"><file name="IndexController.php" hash="108acaab218e2a5e79a12677f83ebc29"/><file name="RecovercartController.php" hash="fab55c8774843ed11e939ee6df1ce0ed"/><file name="SaveaccountController.php" hash="6b490eca17f516a4f95bba9d4c45d30b"/></dir><dir name="etc"><file name="config.xml" hash="6f3bbe6a3fabe3e706c7fc7033913a42"/><file name="system.xml" hash="cb0fbf86d2be47dbd719739ee79c4cba"/></dir><dir name="sql"><dir name="cartsguru_setup"><file name="install-1.0.0.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.0.0-1.0.1.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.0.1-1.0.2.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.0.2-1.1.0.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.1.0-1.1.1.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.1.1-1.1.2.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.1.2-1.1.3.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.1.3-1.1.4 .php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.1.4-1.1.5.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.1.5-1.2.0.php" hash="066c5cfb9870c04737cba2d2edb30a40"/><file name="upgrade-1.2.0-1.2.1.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.2.1-1.2.2.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.2.10-1.2.11.php" hash="84cb92331d31afda4f06aca50dbd597e"/><file name="upgrade-1.2.11-1.2.12.php" hash="84cb92331d31afda4f06aca50dbd597e"/><file name="upgrade-1.2.12-1.2.13.php" hash="84cb92331d31afda4f06aca50dbd597e"/><file name="upgrade-1.2.13-1.2.14.php" hash="84cb92331d31afda4f06aca50dbd597e"/><file name="upgrade-1.2.2-1.2.3.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.2.3-1.2.4.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.2.4-1.2.5.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.2.5-1.2.6.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.2.6-1.2.7.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.2.7-1.2.8.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.2.8-1.2.9.php" hash="381716ae5001678f8bcc6680bad68015"/><file name="upgrade-1.2.9-1.2.10.php" hash="84cb92331d31afda4f06aca50dbd597e"/></dir></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="CartsGuru.csv" hash="b6d51893c33ddef1d53372d3a23b036c"/></dir><dir name="en_US"><file name="CartsGuru.csv" hash="921cb4133db47471456759443bb269f5"/></dir></target><target name="mageetc"><dir name="modules"><file name="Cartsguru.xml" hash="32bfa7d63b1a5b6b8f7977bf31af4e28"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="cartsguru.xml" hash="105f906b9b304bb96b888a9afbefca66"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="cartsguru"><file name="checkout.js" hash="ebbb694ce1eb0e28d208cdb514ab26d3"/></dir></dir></target></contents>
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.3.0</min><max>7.1.0</max></php></required></dependencies>
|
26 |
</package>
|