cartsguru - Version 1.1.5

Version Notes

- Solve issue to identify orders

Download this release

Release Info

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


Code changes from version 1.1.4 to 1.1.5

app/code/local/Cartsguru/Model/Webservice.php CHANGED
@@ -7,6 +7,7 @@
7
  class Cartsguru_Model_Webservice
8
  {
9
  private $apiBaseUrl = 'https://api.carts.guru';
 
10
  /**
11
  * If value is empty return ''
12
  * @param $value
@@ -123,9 +124,6 @@ class Cartsguru_Model_Webservice
123
  //Customer data
124
  $gender = ($order->getCustomerGender()) ? $order->getCustomerGender() : 'mister';
125
  $email = $order->getCustomerEmail();
126
- if (!$accountId = $order->getCustomerId()) {
127
- $accountId = $email;
128
- }
129
 
130
  //Address
131
  $address = $order->getBillingAddress();
@@ -139,9 +137,9 @@ class Cartsguru_Model_Webservice
139
  'creationDate' => $this->formatDate($order->getCreatedAt()), // Date of the order as string in json format
140
  'cartId' => $order->getQuoteId(), // Cart identifier, source of the order
141
  'totalET' => (float)$order->getSubtotal(), // Amount excluded taxes and excluded shipping
142
- 'totalATI' => $this->getTotalATI($items), // Amount included taxes and excluded shipping
143
  'state' => $order->getStatus(), // raw order status
144
- 'accountId' => $accountId, // Account id of the buyer
145
  'ip' => $order->getRemoteIp(), // User IP
146
  'civility' => $this->notEmpty($gender), // Use string in this list : 'mister','madam','miss'
147
  'lastname' => $this->notEmpty($address->getLastname()), // Lastname of the buyer
@@ -177,9 +175,6 @@ class Cartsguru_Model_Webservice
177
  $lastname = $quote->getCustomerLastname();
178
  $firstname = $quote->getCustomerFirstname();
179
  $email = $quote->getCustomerEmail();
180
- if (!$accountId = $quote->getCustomerId()) {
181
- $accountId = $email;
182
- }
183
 
184
  //Lookup for phone & country
185
  $customer = $quote->getCustomer();
@@ -223,7 +218,7 @@ class Cartsguru_Model_Webservice
223
  $items = $this->getItemsData($quote);
224
 
225
  //Check is valid
226
- if (!$items || (!$accountId && (!$phone || !$email))) {
227
  return;
228
  }
229
 
@@ -236,7 +231,7 @@ class Cartsguru_Model_Webservice
236
  'totalET' => (float)$quote->getSubtotal(), // Amount excluded taxes and excluded shipping
237
  'totalATI' => $this->getTotalATI($items), // Amount included taxes and excluded shipping
238
  'ip' => $quote->getRemoteIp(), // User IP
239
- 'accountId' => $accountId, // Account id of the buyer
240
  'civility' => $gender, // Use string in this list : 'mister','madam','miss'
241
  'lastname' => $this->notEmpty($lastname), // Lastname of the buyer
242
  'firstname' => $this->notEmpty($firstname), // Firstname of the buyer
@@ -352,7 +347,7 @@ class Cartsguru_Model_Webservice
352
  $baseUrl = Mage::getBaseUrl() . 'api/rest';
353
  $fields = array(
354
  'plugin' => 'magento',
355
- 'pluginVersion' => '1.1.4',
356
  'storeVersion' => Mage::getVersion()
357
  );
358
  $siteId = Mage::getStoreConfig('cartsguru/cartsguru_group/siteid', Mage::app()->getStore());
@@ -384,4 +379,4 @@ class Cartsguru_Model_Webservice
384
  return $response;
385
  }
386
 
387
- }
7
  class Cartsguru_Model_Webservice
8
  {
9
  private $apiBaseUrl = 'https://api.carts.guru';
10
+
11
  /**
12
  * If value is empty return ''
13
  * @param $value
124
  //Customer data
125
  $gender = ($order->getCustomerGender()) ? $order->getCustomerGender() : 'mister';
126
  $email = $order->getCustomerEmail();
 
 
 
127
 
128
  //Address
129
  $address = $order->getBillingAddress();
137
  'creationDate' => $this->formatDate($order->getCreatedAt()), // Date of the order as string in json format
138
  'cartId' => $order->getQuoteId(), // Cart identifier, source of the order
139
  'totalET' => (float)$order->getSubtotal(), // Amount excluded taxes and excluded shipping
140
+ 'totalATI' => (float)$order->getGrandTotal(), // Paid amount
141
  'state' => $order->getStatus(), // raw order status
142
+ 'accountId' => $email, // Account id of the buyer
143
  'ip' => $order->getRemoteIp(), // User IP
144
  'civility' => $this->notEmpty($gender), // Use string in this list : 'mister','madam','miss'
145
  'lastname' => $this->notEmpty($address->getLastname()), // Lastname of the buyer
175
  $lastname = $quote->getCustomerLastname();
176
  $firstname = $quote->getCustomerFirstname();
177
  $email = $quote->getCustomerEmail();
 
 
 
178
 
179
  //Lookup for phone & country
180
  $customer = $quote->getCustomer();
218
  $items = $this->getItemsData($quote);
219
 
220
  //Check is valid
221
+ if (!$items) {
222
  return;
223
  }
224
 
231
  'totalET' => (float)$quote->getSubtotal(), // Amount excluded taxes and excluded shipping
232
  'totalATI' => $this->getTotalATI($items), // Amount included taxes and excluded shipping
233
  'ip' => $quote->getRemoteIp(), // User IP
234
+ 'accountId' => $email, // Account id of the buyer
235
  'civility' => $gender, // Use string in this list : 'mister','madam','miss'
236
  'lastname' => $this->notEmpty($lastname), // Lastname of the buyer
237
  'firstname' => $this->notEmpty($firstname), // Firstname of the buyer
347
  $baseUrl = Mage::getBaseUrl() . 'api/rest';
348
  $fields = array(
349
  'plugin' => 'magento',
350
+ 'pluginVersion' => '1.1.5',
351
  'storeVersion' => Mage::getVersion()
352
  );
353
  $siteId = Mage::getStoreConfig('cartsguru/cartsguru_group/siteid', Mage::app()->getStore());
379
  return $response;
380
  }
381
 
382
+ }
app/code/local/Cartsguru/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  <!-- plugin name -->
4
  <modules>
5
  <Cartsguru>
6
- <version>1.1.3</version>
7
  </Cartsguru>
8
  </modules>
9
  <global>
3
  <!-- plugin name -->
4
  <modules>
5
  <Cartsguru>
6
+ <version>1.1.5</version>
7
  </Cartsguru>
8
  </modules>
9
  <global>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>cartsguru</name>
4
- <version>1.1.4</version>
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
  &#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 total ATI, can get some issue with other module</notes>
22
  <authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
23
- <date>2016-04-05</date>
24
- <time>13:13:23</time>
25
- <contents><target name="magelocal"><dir name="Cartsguru"><dir name="Helper"><file name="Data.php" hash="f6590d08ba862a169ce43459ddb1193c"/></dir><dir name="Model"><file name="Observer.php" hash="0c8290d79f166c3fb9931994477a059d"/><dir name="Sales"><dir name="Order"><dir name="Api"><file name="V2.php" hash="a3b05d6f3931a1be1b2e92618095a123"/></dir></dir></dir><file name="Webservice.php" hash="dcec5973651768f231045b9ea0e5be8e"/></dir><dir name="etc"><file name="config.xml" hash="12199f27c585a6f7e15ffe232f7e1b0f"/><file name="system.xml" hash="cb0fbf86d2be47dbd719739ee79c4cba"/></dir><dir name="sql"><dir name="cartsguru_setup"><file name="install-1.0.0.php" hash="c46126ce8ce549d525fb25bddc5090b5"/></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.1.5</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>- Solve issue to identify orders</notes>
22
  <authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
23
+ <date>2016-04-15</date>
24
+ <time>14:10:38</time>
25
+ <contents><target name="magelocal"><dir name="Cartsguru"><dir name="Helper"><file name="Data.php" hash="f6590d08ba862a169ce43459ddb1193c"/></dir><dir name="Model"><file name="Observer.php" hash="0c8290d79f166c3fb9931994477a059d"/><dir name="Sales"><dir name="Order"><dir name="Api"><file name="V2.php" hash="a3b05d6f3931a1be1b2e92618095a123"/></dir></dir></dir><file name="Webservice.php" hash="a7c57c1bf1decac804b236949b72790d"/></dir><dir name="etc"><file name="config.xml" hash="5c6be23064582a477f9bc1116b6fbcee"/><file name="system.xml" hash="cb0fbf86d2be47dbd719739ee79c4cba"/></dir><dir name="sql"><dir name="cartsguru_setup"><file name="install-1.0.0.php" hash="c46126ce8ce549d525fb25bddc5090b5"/></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>