cartsguru - Version 1.2.3

Version Notes

- Improve support of multi site env
- Fix send cart without accountId
- Fix handle update of orders

Download this release

Release Info

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


Code changes from version 1.2.2 to 1.2.3

app/code/local/Cartsguru/Model/Webservice.php CHANGED
@@ -9,7 +9,27 @@ class Cartsguru_Model_Webservice
9
  private $apiBaseUrl = 'https://api.carts.guru';
10
  private $configBasePath = 'cartsguru/cartsguru_group/';
11
 
12
- public function setStoreConfig($key, $value, $store = null)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  {
14
  if (!$store){
15
  $store = Mage::app()->getStore();
@@ -262,7 +282,7 @@ class Cartsguru_Model_Webservice
262
  $items = $this->getItemsData($quote);
263
 
264
  //Check is valid
265
- if (sizeof($items) == 0) {
266
  return;
267
  }
268
 
@@ -396,14 +416,16 @@ class Cartsguru_Model_Webservice
396
  */
397
  public function checkAddress()
398
  {
399
- $requestUrl = '/sites/' . $this->getStoreConfig('siteid') . '/register-plugin';
 
 
400
  $fields = array(
401
  'plugin' => 'magento',
402
- 'pluginVersion' => '1.2.2',
403
  'storeVersion' => Mage::getVersion()
404
  );
405
 
406
- $response = $this->doPostRequest($requestUrl, $fields);
407
  $isSuccess = ($response)?
408
  ($response->getStatus() == 200)
409
  : false;
@@ -418,12 +440,12 @@ class Cartsguru_Model_Webservice
418
  * @param $fields
419
  * @return Zend_Http_Response
420
  */
421
- protected function doPostRequest($apiPath, $fields)
422
  {
423
  try {
424
  $url = $this->apiBaseUrl . $apiPath;
425
  $client = new Zend_Http_Client($url);
426
- $client->setHeaders('x-auth-key', $this->getStoreConfig('auth'));
427
  $client->setUri($url);
428
  $client->setRawData(json_encode($fields), 'application/json');
429
  $response = $client->request(Zend_Http_Client::POST);
9
  private $apiBaseUrl = 'https://api.carts.guru';
10
  private $configBasePath = 'cartsguru/cartsguru_group/';
11
 
12
+ protected function getStoreFromAdmin(){
13
+ $store_id;
14
+ if (strlen($code = Mage::getSingleton('adminhtml/config_data')->getStore())) // store level
15
+ {
16
+ $store_id = Mage::getModel('core/store')->load($code)->getId();
17
+ }
18
+ elseif (strlen($code = Mage::getSingleton('adminhtml/config_data')->getWebsite())) // website level
19
+ {
20
+ $website_id = Mage::getModel('core/website')->load($code)->getId();
21
+ $store_id = Mage::app()->getWebsite($website_id)->getDefaultStore()->getId();
22
+ }
23
+
24
+ if ($store_id){
25
+ return Mage::app()->getStore($store_id);
26
+ }
27
+ else {
28
+ return null;
29
+ }
30
+ }
31
+
32
+ protected function setStoreConfig($key, $value, $store = null)
33
  {
34
  if (!$store){
35
  $store = Mage::app()->getStore();
282
  $items = $this->getItemsData($quote);
283
 
284
  //Check is valid
285
+ if (!$email || sizeof($items) == 0) {
286
  return;
287
  }
288
 
416
  */
417
  public function checkAddress()
418
  {
419
+ $store = $this->getStoreFromAdmin();
420
+
421
+ $requestUrl = '/sites/' . $this->getStoreConfig('siteid', $store) . '/register-plugin';
422
  $fields = array(
423
  'plugin' => 'magento',
424
+ 'pluginVersion' => '1.2.3',
425
  'storeVersion' => Mage::getVersion()
426
  );
427
 
428
+ $response = $this->doPostRequest($requestUrl, $fields, $store);
429
  $isSuccess = ($response)?
430
  ($response->getStatus() == 200)
431
  : false;
440
  * @param $fields
441
  * @return Zend_Http_Response
442
  */
443
+ protected function doPostRequest($apiPath, $fields, $store=null)
444
  {
445
  try {
446
  $url = $this->apiBaseUrl . $apiPath;
447
  $client = new Zend_Http_Client($url);
448
+ $client->setHeaders('x-auth-key', $this->getStoreConfig('auth', $store));
449
  $client->setUri($url);
450
  $client->setRawData(json_encode($fields), 'application/json');
451
  $response = $client->request(Zend_Http_Client::POST);
app/code/local/Cartsguru/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  <!-- plugin name -->
4
  <modules>
5
  <Cartsguru>
6
- <version>1.2.2</version>
7
  </Cartsguru>
8
  </modules>
9
  <global>
3
  <!-- plugin name -->
4
  <modules>
5
  <Cartsguru>
6
+ <version>1.2.3</version>
7
  </Cartsguru>
8
  </modules>
9
  <global>
app/code/local/Cartsguru/sql/cartsguru_setup/upgrade-1.2.2-1.2.3.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.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
@@ -18,13 +18,13 @@ Effortlessly reduce the number of abandoned shopping carts by automating telepho
18
  &#xD;
19
  - SMS Callback &amp;amp; Push SMS&#xD;
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 compatibility with 1.7 &amp; 1.8&#xD;
22
- - Improve SQL upgrade management&#xD;
23
- - Add compatibility with 1.6</notes>
24
  <authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
25
- <date>2016-04-27</date>
26
- <time>16:22:43</time>
27
- <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="7b3b398b86a9b8e044f7d00f6b72e196"/><file name="Webservice.php" hash="7272510a152e9a2447f5c1751a0646fa"/></dir><dir name="controllers"><file name="IndexController.php" hash="108acaab218e2a5e79a12677f83ebc29"/><file name="RecovercartController.php" hash="c5272eaae6eba7658155a83c27b94139"/></dir><dir name="etc"><file name="config.xml" hash="b2b13c14d50a71d8de838aaa72020110"/><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"/></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>
28
  <compatible/>
29
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
30
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>cartsguru</name>
4
+ <version>1.2.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
18
  &#xD;
19
  - SMS Callback &amp;amp; Push SMS&#xD;
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 support of multi site env&#xD;
22
+ - Fix send cart without accountId&#xD;
23
+ - Fix handle update of orders</notes>
24
  <authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
25
+ <date>2016-05-18</date>
26
+ <time>13:58:09</time>
27
+ <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="7b3b398b86a9b8e044f7d00f6b72e196"/><file name="Webservice.php" hash="7114b519d9444dba72ae4d21c7458589"/></dir><dir name="controllers"><file name="IndexController.php" hash="108acaab218e2a5e79a12677f83ebc29"/><file name="RecovercartController.php" hash="c5272eaae6eba7658155a83c27b94139"/></dir><dir name="etc"><file name="config.xml" hash="815fb95fd37989b7aca22aacc4758558"/><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"/></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>
28
  <compatible/>
29
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
30
  </package>