Version Notes
- Improve multi store compatibility
Download this release
Release Info
| Developer | Maxime Pruvost |
| Extension | cartsguru |
| Version | 1.2.9 |
| Comparing to | |
| See all releases | |
Code changes from version 1.2.8 to 1.2.9
app/code/local/Cartsguru/Model/Webservice.php
CHANGED
|
@@ -51,8 +51,12 @@ class Cartsguru_Model_Webservice
|
|
| 51 |
return $store->getConfig($this->configBasePath . $key);
|
| 52 |
}
|
| 53 |
|
| 54 |
-
protected function isStoreConfigured(){
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
}
|
| 57 |
|
| 58 |
/**
|
|
@@ -207,19 +211,21 @@ class Cartsguru_Model_Webservice
|
|
| 207 |
*/
|
| 208 |
public function sendOrder($order)
|
| 209 |
{
|
|
|
|
|
|
|
| 210 |
//Check is well configured
|
| 211 |
-
if (!$this->isStoreConfigured()){
|
| 212 |
return;
|
| 213 |
}
|
| 214 |
|
| 215 |
//Get data, stop if none
|
| 216 |
-
$orderData = $this->getOrderData($order);
|
| 217 |
if (empty($orderData)) {
|
| 218 |
return;
|
| 219 |
}
|
| 220 |
|
| 221 |
//Push data to api
|
| 222 |
-
$this->doPostRequest('/orders', $orderData);
|
| 223 |
}
|
| 224 |
|
| 225 |
/**
|
|
@@ -326,37 +332,35 @@ class Cartsguru_Model_Webservice
|
|
| 326 |
* This method send abounded cart data
|
| 327 |
* @param $quote
|
| 328 |
*/
|
| 329 |
-
public function sendAbadonnedCart($quote
|
| 330 |
{
|
|
|
|
|
|
|
| 331 |
//Check is well configured
|
| 332 |
-
if (!$this->isStoreConfigured()){
|
| 333 |
return;
|
| 334 |
}
|
| 335 |
|
| 336 |
//Get data and continue only if exist
|
| 337 |
-
$cartData = $this->getAbadonnedCartData($quote);
|
| 338 |
if (!$cartData){
|
| 339 |
return;
|
| 340 |
}
|
| 341 |
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
$dataMd5 = md5(json_encode($cartData));
|
| 348 |
-
|
| 349 |
-
if ($dataMd5 == $cachedMd5) {
|
| 350 |
-
return;
|
| 351 |
-
}
|
| 352 |
|
| 353 |
-
|
|
|
|
| 354 |
}
|
| 355 |
|
| 356 |
-
|
| 357 |
-
|
| 358 |
|
| 359 |
-
$this->doPostRequest($
|
| 360 |
}
|
| 361 |
|
| 362 |
/**
|
|
@@ -447,7 +451,7 @@ class Cartsguru_Model_Webservice
|
|
| 447 |
$requestUrl = '/sites/' . $this->getStoreConfig('siteid', $store) . '/register-plugin';
|
| 448 |
$fields = array(
|
| 449 |
'plugin' => 'magento',
|
| 450 |
-
'pluginVersion' => '1.2.
|
| 451 |
'storeVersion' => Mage::getVersion()
|
| 452 |
);
|
| 453 |
|
| 51 |
return $store->getConfig($this->configBasePath . $key);
|
| 52 |
}
|
| 53 |
|
| 54 |
+
protected function isStoreConfigured($store = null){
|
| 55 |
+
if (!$store){
|
| 56 |
+
$store = Mage::app()->getStore();
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
return $this->getStoreConfig('siteid',$store) && $this->getStoreConfig('auth',$store);
|
| 60 |
}
|
| 61 |
|
| 62 |
/**
|
| 211 |
*/
|
| 212 |
public function sendOrder($order)
|
| 213 |
{
|
| 214 |
+
$store = Mage::app()->getStore($order->getStoreId());
|
| 215 |
+
|
| 216 |
//Check is well configured
|
| 217 |
+
if (!$this->isStoreConfigured($store)){
|
| 218 |
return;
|
| 219 |
}
|
| 220 |
|
| 221 |
//Get data, stop if none
|
| 222 |
+
$orderData = $this->getOrderData($order,$store);
|
| 223 |
if (empty($orderData)) {
|
| 224 |
return;
|
| 225 |
}
|
| 226 |
|
| 227 |
//Push data to api
|
| 228 |
+
$this->doPostRequest('/orders', $orderData, $store);
|
| 229 |
}
|
| 230 |
|
| 231 |
/**
|
| 332 |
* This method send abounded cart data
|
| 333 |
* @param $quote
|
| 334 |
*/
|
| 335 |
+
public function sendAbadonnedCart($quote)
|
| 336 |
{
|
| 337 |
+
$store = Mage::app()->getStore($quote->getStoreId());
|
| 338 |
+
|
| 339 |
//Check is well configured
|
| 340 |
+
if (!$this->isStoreConfigured($store)){
|
| 341 |
return;
|
| 342 |
}
|
| 343 |
|
| 344 |
//Get data and continue only if exist
|
| 345 |
+
$cartData = $this->getAbadonnedCartData($quote, $store);
|
| 346 |
if (!$cartData){
|
| 347 |
return;
|
| 348 |
}
|
| 349 |
|
| 350 |
+
//Check not already sent
|
| 351 |
+
$cache = Mage::app()->getCache();
|
| 352 |
+
$cacheId = 'cg-quote-' . $quote->getId();
|
| 353 |
+
$cachedMd5 = $cache->load($cacheId);
|
| 354 |
+
$dataMd5 = md5(json_encode($cartData));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 355 |
|
| 356 |
+
if ($dataMd5 == $cachedMd5) {
|
| 357 |
+
return;
|
| 358 |
}
|
| 359 |
|
| 360 |
+
$cache->save($dataMd5, $cacheId);
|
| 361 |
+
|
| 362 |
|
| 363 |
+
$this->doPostRequest('/carts', $cartData, $store);
|
| 364 |
}
|
| 365 |
|
| 366 |
/**
|
| 451 |
$requestUrl = '/sites/' . $this->getStoreConfig('siteid', $store) . '/register-plugin';
|
| 452 |
$fields = array(
|
| 453 |
'plugin' => 'magento',
|
| 454 |
+
'pluginVersion' => '1.2.9',
|
| 455 |
'storeVersion' => Mage::getVersion()
|
| 456 |
);
|
| 457 |
|
app/code/local/Cartsguru/etc/config.xml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<!-- plugin name -->
|
| 4 |
<modules>
|
| 5 |
<Cartsguru>
|
| 6 |
-
<version>1.2.
|
| 7 |
</Cartsguru>
|
| 8 |
</modules>
|
| 9 |
<global>
|
| 3 |
<!-- plugin name -->
|
| 4 |
<modules>
|
| 5 |
<Cartsguru>
|
| 6 |
+
<version>1.2.9</version>
|
| 7 |
</Cartsguru>
|
| 8 |
</modules>
|
| 9 |
<global>
|
app/code/local/Cartsguru/sql/cartsguru_setup/upgrade-1.2.8-1.2.9.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();
|
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>
|
|
@@ -18,11 +18,11 @@ Effortlessly reduce the number of abandoned shopping carts by automating telepho
|
|
| 18 |

|
| 19 |
- SMS Callback &amp; Push SMS
|
| 20 |
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>
|
| 21 |
-
<notes>-
|
| 22 |
<authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
|
| 23 |
-
<date>2016-
|
| 24 |
-
<time>
|
| 25 |
-
<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="d729fe51e4430b0becdefc239ecce351"/><file name="Webservice.php" hash="
|
| 26 |
<compatible/>
|
| 27 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
| 28 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>cartsguru</name>
|
| 4 |
+
<version>1.2.9</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
|
| 7 |
<channel>community</channel>
|
| 18 |

|
| 19 |
- SMS Callback &amp; Push SMS
|
| 20 |
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>
|
| 21 |
+
<notes>- Improve multi store compatibility</notes>
|
| 22 |
<authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
|
| 23 |
+
<date>2016-08-03</date>
|
| 24 |
+
<time>13:49:50</time>
|
| 25 |
+
<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="d729fe51e4430b0becdefc239ecce351"/><file name="Webservice.php" hash="35cebb3a032fb218d7b710d21c363cd9"/></dir><dir name="controllers"><file name="IndexController.php" hash="108acaab218e2a5e79a12677f83ebc29"/><file name="RecovercartController.php" hash="fab55c8774843ed11e939ee6df1ce0ed"/></dir><dir name="etc"><file name="config.xml" hash="604fb6f5fa8e9c6c7b7005b578598922"/><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.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"/></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></contents>
|
| 26 |
<compatible/>
|
| 27 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
| 28 |
</package>
|
