cartsguru - Version 1.2.14

Version Notes

- Support php7
- Improve performance

Download this release

Release Info

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


Code changes from version 1.2.13 to 1.2.14

app/code/local/Cartsguru/Model/Webservice.php CHANGED
@@ -17,6 +17,8 @@ class Cartsguru_Model_Webservice
17
  const QUOTES_CACHE_TAG = 'cartsguru_carts';
18
  const QUOTES_CACHE_TTL = 1800; // 30min in seconds
19
 
 
 
20
  protected function getStoreFromAdmin(){
21
  $store_id = null;
22
  if (strlen($code = Mage::getSingleton('adminhtml/config_data')->getStore())) // store level
@@ -129,6 +131,29 @@ class Cartsguru_Model_Webservice
129
  return $totalATI;
130
  }
131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  /**
133
  * This method build items from order or quote
134
  * @param $obj order or quote
@@ -145,18 +170,11 @@ class Cartsguru_Model_Webservice
145
  if (!$productData) {
146
  $product = Mage::getModel('catalog/product')->load($item->getProductId());
147
 
148
- if ($product->getImage() == 'no_selection' || !$product->getImage()){
149
- $imageUrl = $this->notEmpty(null);
150
- }
151
- else {
152
- $imageUrl = $product->getSmallImageUrl(120, 120);
153
- }
154
-
155
  $categoryNames = $this->getCatNames($product);
156
 
157
  $productData = array(
158
  'url' => $product->getProductUrl(), // URL of product sheet
159
- 'imageUrl' => $imageUrl, // URL of product image
160
  'universe' => $this->notEmpty($categoryNames[1]), // Main category
161
  'category' => $this->notEmpty(end($categoryNames)) // Child category
162
  );
@@ -476,11 +494,11 @@ class Cartsguru_Model_Webservice
476
  $requestUrl = '/sites/' . $this->getStoreConfig('siteid', $store) . '/register-plugin';
477
  $fields = array(
478
  'plugin' => 'magento',
479
- 'pluginVersion' => '1.2.13',
480
  'storeVersion' => Mage::getVersion()
481
  );
482
 
483
- $response = $this->doPostRequest($requestUrl, $fields, $store);
484
 
485
  if (!$response || $response->getStatus() != 200){
486
  return false;
@@ -575,12 +593,19 @@ class Cartsguru_Model_Webservice
575
  * @param $fields
576
  * @return Zend_Http_Response
577
  */
578
- private function doPostRequest($apiPath, $fields, $store=null)
579
  {
 
 
580
  try {
581
  $url = $this->apiBaseUrl . $apiPath;
582
- $client = new Zend_Http_Client($url);
 
 
 
 
583
  $client->setHeaders('x-auth-key', $this->getStoreConfig('auth', $store));
 
584
  $client->setUri($url);
585
  $client->setRawData(json_encode($fields), 'application/json');
586
  $response = $client->request(Zend_Http_Client::POST);
17
  const QUOTES_CACHE_TAG = 'cartsguru_carts';
18
  const QUOTES_CACHE_TTL = 1800; // 30min in seconds
19
 
20
+ const _CARTSGURU_VERSION_ = '1.2.14';
21
+
22
  protected function getStoreFromAdmin(){
23
  $store_id = null;
24
  if (strlen($code = Mage::getSingleton('adminhtml/config_data')->getStore())) // store level
131
  return $totalATI;
132
  }
133
 
134
+ protected function getProudctImageUrl($product){
135
+ if ($product->getImage() == 'no_selection' || !$product->getImage()){
136
+ return $imageUrl = $this->notEmpty(null);
137
+ }
138
+
139
+ $image = null;
140
+
141
+ //Handle 1.9.0 feature
142
+ if (version_compare(Mage::getVersion(), '1.9.0', '>=')){
143
+ //Check if need resize or not
144
+ if (Mage::getStoreConfig(Mage_Catalog_Helper_Image::XML_NODE_PRODUCT_SMALL_IMAGE_WIDTH) < 120){
145
+ $image = Mage::helper('catalog/image')->init($product, 'image')->resize(120,120);
146
+ }
147
+ else {
148
+ $image = Mage::helper('catalog/image')->init($product, 'small_image');
149
+ }
150
+ } else {
151
+ $image = Mage::helper('catalog/image')->init($product, 'small_image');
152
+ }
153
+
154
+ return (string)$image;
155
+ }
156
+
157
  /**
158
  * This method build items from order or quote
159
  * @param $obj order or quote
170
  if (!$productData) {
171
  $product = Mage::getModel('catalog/product')->load($item->getProductId());
172
 
 
 
 
 
 
 
 
173
  $categoryNames = $this->getCatNames($product);
174
 
175
  $productData = array(
176
  'url' => $product->getProductUrl(), // URL of product sheet
177
+ 'imageUrl' => $this->getProudctImageUrl($product), // URL of product image
178
  'universe' => $this->notEmpty($categoryNames[1]), // Main category
179
  'category' => $this->notEmpty(end($categoryNames)) // Child category
180
  );
494
  $requestUrl = '/sites/' . $this->getStoreConfig('siteid', $store) . '/register-plugin';
495
  $fields = array(
496
  'plugin' => 'magento',
497
+ 'pluginVersion' => Cartsguru_Model_Webservice::_CARTSGURU_VERSION_,
498
  'storeVersion' => Mage::getVersion()
499
  );
500
 
501
+ $response = $this->doPostRequest($requestUrl, $fields, $store, true);
502
 
503
  if (!$response || $response->getStatus() != 200){
504
  return false;
593
  * @param $fields
594
  * @return Zend_Http_Response
595
  */
596
+ private function doPostRequest($apiPath, $fields, $store=null, $isSync=false)
597
  {
598
+ $response = null;
599
+
600
  try {
601
  $url = $this->apiBaseUrl . $apiPath;
602
+ $options = array(
603
+ 'storeresponse' => false, //We don't need store the response for later
604
+ 'timeout' => $isSync ? 10 : 1 //We need only wait if is sync, seconds as integer
605
+ );
606
+ $client = new Zend_Http_Client($url, $options);
607
  $client->setHeaders('x-auth-key', $this->getStoreConfig('auth', $store));
608
+ $client->setHeaders('x-plugin-version', Cartsguru_Model_Webservice::_CARTSGURU_VERSION_);
609
  $client->setUri($url);
610
  $client->setRawData(json_encode($fields), 'application/json');
611
  $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.13</version>
7
  </Cartsguru>
8
  </modules>
9
  <global>
3
  <!-- plugin name -->
4
  <modules>
5
  <Cartsguru>
6
+ <version>1.2.14</version>
7
  </Cartsguru>
8
  </modules>
9
  <global>
app/code/local/Cartsguru/sql/cartsguru_setup/upgrade-1.2.13-1.2.14.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,28 +1,27 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>cartsguru</name>
4
- <version>1.2.13</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>The first targeted and automated follow-up solution for abandoned carts through phone and text message !</summary>
10
  <description>There is a way to transform those abandoned shopping carts into sales !&#xD;
11
- &#xD;
12
  Carts Guru enable you to establish automatic contact with your prospective customers who did not finalize their purchase.&#xD;
13
- &#xD;
14
  Targets your abandoned shopping carts, define your rules and run actions automatically thought phone and SMS&#xD;
15
  &#xD;
16
- - Automatic call &#xD;
17
  Effortlessly reduce the number of abandoned shopping carts by automating telephone contact between your salespeople and the customers who have just left your site&#xD;
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>- Fix notice warning</notes>
 
22
  <authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
23
- <date>2016-10-19</date>
24
- <time>08:35:22</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="93ad478de9ac40d76c65dd1054d9f5a5"/><file name="Webservice.php" hash="0cb309b4c8f48d7c9a072fa206ec6bb4"/></dir><dir name="controllers"><file name="IndexController.php" hash="108acaab218e2a5e79a12677f83ebc29"/><file name="RecovercartController.php" hash="fab55c8774843ed11e939ee6df1ce0ed"/><file name="SaveaccountController.php" hash="9a59b2cbd9b7d92b97b768d86ccdb63a"/></dir><dir name="etc"><file name="config.xml" hash="61298922d56669e847accea3d2d3ddf8"/><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.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></contents>
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.14</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>The first targeted and automated follow-up solution for abandoned carts through phone and text message !</summary>
10
  <description>There is a way to transform those abandoned shopping carts into sales !&#xD;
 
11
  Carts Guru enable you to establish automatic contact with your prospective customers who did not finalize their purchase.&#xD;
 
12
  Targets your abandoned shopping carts, define your rules and run actions automatically thought phone and SMS&#xD;
13
  &#xD;
14
+ - Automatic call&#xD;
15
  Effortlessly reduce the number of abandoned shopping carts by automating telephone contact between your salespeople and the customers who have just left your site&#xD;
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>- Support php7&#xD;
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-02</date>
23
+ <time>13:17:25</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="1d91a3095708bdf6e0b773b0818bb257"/></dir><dir name="controllers"><file name="IndexController.php" hash="108acaab218e2a5e79a12677f83ebc29"/><file name="RecovercartController.php" hash="fab55c8774843ed11e939ee6df1ce0ed"/><file name="SaveaccountController.php" hash="9a59b2cbd9b7d92b97b768d86ccdb63a"/></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></contents>
25
  <compatible/>
26
+ <dependencies><required><php><min>5.3.0</min><max>7.1.0</max></php></required></dependencies>
27
  </package>