cartsguru - Version 1.3.1

Version Notes

- Improve live tracking. Handle discounts in totalET

Download this release

Release Info

Developer Maxime Pruvost
Extension cartsguru
Version 1.3.1
Comparing to
See all releases


Code changes from version 1.3.0 to 1.3.1

app/code/local/Cartsguru/Block/Pixel.php CHANGED
@@ -38,4 +38,11 @@ class Cartsguru_Block_Pixel extends Mage_Core_Block_Template
38
}
39
return false;
40
}
41
}
38
}
39
return false;
40
}
41
+ /**
42
+ * Get the tracking URL
43
+ */
44
+ protected function getTrackingURL()
45
+ {
46
+ return $this->getUrl('cartsguru/saveaccount');
47
+ }
48
}
app/code/local/Cartsguru/Model/Webservice.php CHANGED
@@ -17,7 +17,7 @@ class Cartsguru_Model_Webservice
17
const QUOTES_CACHE_TAG = 'cartsguru_carts';
18
const QUOTES_CACHE_TTL = 1800; // 30min in seconds
19
20
- const _CARTSGURU_VERSION_ = '1.3.0';
21
22
protected function getStoreFromAdmin(){
23
$store_id = null;
@@ -241,13 +241,15 @@ class Cartsguru_Model_Webservice
241
'customerGroup' => $helper->getCustomerGroupName(),
242
'isNewCustomer' => $helper->isNewCustomer($email)
243
);
244
245
return array(
246
'siteId' => $this->getStoreConfig('siteid', $store), // SiteId is part of plugin configuration
247
'id' => $order->getIncrementId(), // Order reference, the same display to the buyer
248
'creationDate' => $this->formatDate($order->getCreatedAt()), // Date of the order as string in json format
249
'cartId' => $order->getQuoteId(), // Cart identifier, source of the order
250
- 'totalET' => (float)$order->getSubtotal(), // Amount excluded taxes and excluded shipping
251
'totalATI' => (float)$order->getGrandTotal(), // Paid amount
252
'currency' => $order->getOrderCurrencyCode(), // Currency as USD, EUR
253
'paymentMethod' => $order->getPayment()->getMethodInstance()->getTitle(), // Payment method label
17
const QUOTES_CACHE_TAG = 'cartsguru_carts';
18
const QUOTES_CACHE_TTL = 1800; // 30min in seconds
19
20
+ const _CARTSGURU_VERSION_ = '1.3.1';
21
22
protected function getStoreFromAdmin(){
23
$store_id = null;
241
'customerGroup' => $helper->getCustomerGroupName(),
242
'isNewCustomer' => $helper->isNewCustomer($email)
243
);
244
+ // We do this to include the discounts in the totalET
245
+ $totalET = number_format((float)($order->getTotalDue() - $order->getShippingAmount() - $order->getTaxAmount()), 2);
246
247
return array(
248
'siteId' => $this->getStoreConfig('siteid', $store), // SiteId is part of plugin configuration
249
'id' => $order->getIncrementId(), // Order reference, the same display to the buyer
250
'creationDate' => $this->formatDate($order->getCreatedAt()), // Date of the order as string in json format
251
'cartId' => $order->getQuoteId(), // Cart identifier, source of the order
252
+ 'totalET' => $totalET, // Amount excluded taxes and excluded shipping
253
'totalATI' => (float)$order->getGrandTotal(), // Paid amount
254
'currency' => $order->getOrderCurrencyCode(), // Currency as USD, EUR
255
'paymentMethod' => $order->getPayment()->getMethodInstance()->getTitle(), // Payment method label
app/code/local/Cartsguru/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
<!-- plugin name -->
4
<modules>
5
<Cartsguru>
6
- <version>1.3.0</version>
7
</Cartsguru>
8
</modules>
9
<global>
3
<!-- plugin name -->
4
<modules>
5
<Cartsguru>
6
+ <version>1.3.1</version>
7
</Cartsguru>
8
</modules>
9
<global>
app/code/local/Cartsguru/sql/cartsguru_setup/upgrade-1.3.0-1.3.1.php ADDED
@@ -0,0 +1,6 @@
1
+ <?php
2
+ /* @var $installer Mage_Core_Model_Resource_Setup */
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+ $installer->endSetup();
app/design/frontend/base/default/template/cartsguru/pixel.phtml CHANGED
@@ -30,3 +30,7 @@ $catalogId = $this->getCatalogId();
30
</noscript>
31
<!-- End Facebook Pixel Code -->
32
<?php endif; ?>
30
</noscript>
31
<!-- End Facebook Pixel Code -->
32
<?php endif; ?>
33
+
34
+ <script>
35
+ var cartsguru_tracking_url = '<?php echo $this->getTrackingURL(); ?>';
36
+ </script>
js/cartsguru/checkout.js CHANGED
@@ -53,10 +53,11 @@
53
}
54
55
function trackData () {
56
- var data = collectData();
57
if (data) {
58
xhr = new XMLHttpRequest();
59
- xhr.open('POST', '/cartsguru/saveaccount', true);
60
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
61
xhr.send(data.join("&"));
62
}
53
}
54
55
function trackData () {
56
+ var data = collectData(),
57
+ trackingURL = typeof cartsguru_tracking_url !== 'undefined' ? cartsguru_tracking_url : '/cartsguru/saveaccount';
58
if (data) {
59
xhr = new XMLHttpRequest();
60
+ xhr.open('POST', trackingURL, true);
61
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
62
xhr.send(data.join("&"));
63
}
package.xml CHANGED
@@ -1,7 +1,7 @@
1
<?xml version="1.0"?>
2
<package>
3
<name>cartsguru</name>
4
- <version>1.3.0</version>
5
<stability>stable</stability>
6
<license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
7
<channel>community</channel>
@@ -16,11 +16,11 @@ Effortlessly reduce the number of abandoned shopping carts by automating telepho
16
&#xD;
17
- SMS Callback &amp; Push SMS&#xD;
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>- Added Facebook retargeting integration</notes>
20
<authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
21
- <date>2016-12-20</date>
22
- <time>15:32:15</time>
23
- <contents><target name="magelocal"><dir name="Cartsguru"><dir name="Block"><file name="Pixel.php" hash="41b3ef3ca05c5341d2c94c99fc8cdd14"/></dir><dir name="Helper"><file name="Data.php" hash="bfdd570b0b1398578bd50354acfaee50"/><file name="Tools.php" hash="e2f56c3387eb0b0650aa5f49f8207618"/></dir><dir name="Model"><file name="Catalog.php" hash="93b42e79b4350978aa6da15e6305835c"/><file name="Observer.php" hash="6fbedb182fee9f8d52d8f86b9608c92a"/><file name="Webservice.php" hash="4dafc50cdc1cc664e69997618569a625"/></dir><dir name="controllers"><file name="AdminController.php" hash="35691c3127363c623e5c0c1a83a5c951"/><file name="CatalogController.php" hash="ce0b4523b20b094f1d0b438f0b8b1d42"/><file name="IndexController.php" hash="21147a5de4f498b13e9f402100a868e9"/><file name="RecovercartController.php" hash="4b0d7b3c0d18f5c451932caee9daac5b"/><file name="SaveaccountController.php" hash="6b490eca17f516a4f95bba9d4c45d30b"/></dir><dir name="etc"><file name="config.xml" hash="e08d9a1c57995818f0688c577062a726"/><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.14-1.2.15.php" hash="c96e44a4737e1d8b0f4915c55a67c048"/><file name="upgrade-1.2.15-1.2.16.php" hash="c96e44a4737e1d8b0f4915c55a67c048"/><file name="upgrade-1.2.16-1.3.0.php" hash="c96e44a4737e1d8b0f4915c55a67c048"/><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="a886b0c3b06fdc08d1602c3f1fa0eff0"/></dir><dir name="template"><dir name="cartsguru"><dir name="checkout"><file name="purchase.phtml" hash="1035c7fed71153aa4c9f5e2d765deb7a"/></dir><file name="pixel.phtml" hash="501f22c8734c63abee6eb985eea05ee6"/><dir name="product"><file name="view.phtml" hash="9ab2487a583615c61e85a96ee0795ad3"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="cartsguru"><file name="checkout.js" hash="1be2d62171ffbafe51f66dc1abc1a332"/></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>
1
<?xml version="1.0"?>
2
<package>
3
<name>cartsguru</name>
4
+ <version>1.3.1</version>
5
<stability>stable</stability>
6
<license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
7
<channel>community</channel>
16
&#xD;
17
- SMS Callback &amp; Push SMS&#xD;
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>- Improve live tracking. Handle discounts in totalET</notes>
20
<authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
21
+ <date>2016-12-22</date>
22
+ <time>10:02:58</time>
23
+ <contents><target name="magelocal"><dir name="Cartsguru"><dir name="Block"><file name="Pixel.php" hash="1b0cce98dd02499a94534201329033b0"/></dir><dir name="Helper"><file name="Data.php" hash="bfdd570b0b1398578bd50354acfaee50"/><file name="Tools.php" hash="e2f56c3387eb0b0650aa5f49f8207618"/></dir><dir name="Model"><file name="Catalog.php" hash="93b42e79b4350978aa6da15e6305835c"/><file name="Observer.php" hash="6fbedb182fee9f8d52d8f86b9608c92a"/><file name="Webservice.php" hash="87bcebfce9b2ad5f4a79135cd340a0fd"/></dir><dir name="controllers"><file name="AdminController.php" hash="35691c3127363c623e5c0c1a83a5c951"/><file name="CatalogController.php" hash="ce0b4523b20b094f1d0b438f0b8b1d42"/><file name="IndexController.php" hash="21147a5de4f498b13e9f402100a868e9"/><file name="RecovercartController.php" hash="4b0d7b3c0d18f5c451932caee9daac5b"/><file name="SaveaccountController.php" hash="6b490eca17f516a4f95bba9d4c45d30b"/></dir><dir name="etc"><file name="config.xml" hash="d9993f8ded31e1aa50ee3a0faa0fcc6a"/><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.14-1.2.15.php" hash="c96e44a4737e1d8b0f4915c55a67c048"/><file name="upgrade-1.2.15-1.2.16.php" hash="c96e44a4737e1d8b0f4915c55a67c048"/><file name="upgrade-1.2.16-1.3.0.php" hash="c96e44a4737e1d8b0f4915c55a67c048"/><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"/><file name="upgrade-1.3.0-1.3.1.php" hash="c96e44a4737e1d8b0f4915c55a67c048"/></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="a886b0c3b06fdc08d1602c3f1fa0eff0"/></dir><dir name="template"><dir name="cartsguru"><dir name="checkout"><file name="purchase.phtml" hash="1035c7fed71153aa4c9f5e2d765deb7a"/></dir><file name="pixel.phtml" hash="58cbe4af75828b12325251cb4cf1d594"/><dir name="product"><file name="view.phtml" hash="9ab2487a583615c61e85a96ee0795ad3"/></dir></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="cartsguru"><file name="checkout.js" hash="f80f26b465eac6f702e87e05687c4bdd"/></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>