Version Notes
- Fix total ATI, can get some issue with other module
Download this release
Release Info
Developer | Maxime Pruvost |
Extension | cartsguru |
Version | 1.1.4 |
Comparing to | |
See all releases |
Code changes from version 1.1.3 to 1.1.4
- app/code/local/Cartsguru/Model/Webservice.php +15 -7
- package.xml +4 -6
app/code/local/Cartsguru/Model/Webservice.php
CHANGED
@@ -7,7 +7,6 @@
|
|
7 |
class Cartsguru_Model_Webservice
|
8 |
{
|
9 |
private $apiBaseUrl = 'https://api.carts.guru';
|
10 |
-
|
11 |
/**
|
12 |
* If value is empty return ''
|
13 |
* @param $value
|
@@ -62,8 +61,14 @@ class Cartsguru_Model_Webservice
|
|
62 |
* @param $obj order or quote
|
63 |
* @return float
|
64 |
*/
|
65 |
-
public function getTotalATI($
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
|
69 |
/**
|
@@ -124,6 +129,9 @@ class Cartsguru_Model_Webservice
|
|
124 |
|
125 |
//Address
|
126 |
$address = $order->getBillingAddress();
|
|
|
|
|
|
|
127 |
|
128 |
return array(
|
129 |
'siteId' => Mage::getStoreConfig('cartsguru/cartsguru_group/siteid', Mage::app()->getStore()), //Site Id
|
@@ -131,7 +139,7 @@ class Cartsguru_Model_Webservice
|
|
131 |
'creationDate' => $this->formatDate($order->getCreatedAt()), // Date of the order as string in json format
|
132 |
'cartId' => $order->getQuoteId(), // Cart identifier, source of the order
|
133 |
'totalET' => (float)$order->getSubtotal(), // Amount excluded taxes and excluded shipping
|
134 |
-
'totalATI' => $this->getTotalATI($
|
135 |
'state' => $order->getStatus(), // raw order status
|
136 |
'accountId' => $accountId, // Account id of the buyer
|
137 |
'ip' => $order->getRemoteIp(), // User IP
|
@@ -141,7 +149,7 @@ class Cartsguru_Model_Webservice
|
|
141 |
'email' => $this->notEmpty($email), // Email of the buye
|
142 |
'phoneNumber' => $this->notEmpty($address->getTelephone()), // Landline phone number of buyer (internationnal format)
|
143 |
'countryCode' => $this->notEmpty($address->getCountryId()), // Country code of buyer
|
144 |
-
'items' => $
|
145 |
);
|
146 |
}
|
147 |
|
@@ -226,7 +234,7 @@ class Cartsguru_Model_Webservice
|
|
226 |
'id' => $quote->getId(), //Order reference, the same display to the buyer
|
227 |
'creationDate' => $this->formatDate($quote->getCreatedAt()), // Date of the order as string in json format
|
228 |
'totalET' => (float)$quote->getSubtotal(), // Amount excluded taxes and excluded shipping
|
229 |
-
'totalATI' => $this->getTotalATI($
|
230 |
'ip' => $quote->getRemoteIp(), // User IP
|
231 |
'accountId' => $accountId, // Account id of the buyer
|
232 |
'civility' => $gender, // Use string in this list : 'mister','madam','miss'
|
@@ -344,7 +352,7 @@ class Cartsguru_Model_Webservice
|
|
344 |
$baseUrl = Mage::getBaseUrl() . 'api/rest';
|
345 |
$fields = array(
|
346 |
'plugin' => 'magento',
|
347 |
-
'pluginVersion' => '1.1.
|
348 |
'storeVersion' => Mage::getVersion()
|
349 |
);
|
350 |
$siteId = Mage::getStoreConfig('cartsguru/cartsguru_group/siteid', Mage::app()->getStore());
|
7 |
class Cartsguru_Model_Webservice
|
8 |
{
|
9 |
private $apiBaseUrl = 'https://api.carts.guru';
|
|
|
10 |
/**
|
11 |
* If value is empty return ''
|
12 |
* @param $value
|
61 |
* @param $obj order or quote
|
62 |
* @return float
|
63 |
*/
|
64 |
+
public function getTotalATI($items){
|
65 |
+
$totalATI = (float)0;
|
66 |
+
|
67 |
+
foreach ($items as $item) {
|
68 |
+
$totalATI += $item['totalATI'];
|
69 |
+
}
|
70 |
+
|
71 |
+
return $totalATI;
|
72 |
}
|
73 |
|
74 |
/**
|
129 |
|
130 |
//Address
|
131 |
$address = $order->getBillingAddress();
|
132 |
+
|
133 |
+
//Items details
|
134 |
+
$items = $this->getItemsData($order);
|
135 |
|
136 |
return array(
|
137 |
'siteId' => Mage::getStoreConfig('cartsguru/cartsguru_group/siteid', Mage::app()->getStore()), //Site Id
|
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
|
149 |
'email' => $this->notEmpty($email), // Email of the buye
|
150 |
'phoneNumber' => $this->notEmpty($address->getTelephone()), // Landline phone number of buyer (internationnal format)
|
151 |
'countryCode' => $this->notEmpty($address->getCountryId()), // Country code of buyer
|
152 |
+
'items' => $items // Details
|
153 |
);
|
154 |
}
|
155 |
|
234 |
'id' => $quote->getId(), //Order reference, the same display to the buyer
|
235 |
'creationDate' => $this->formatDate($quote->getCreatedAt()), // Date of the order as string in json format
|
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'
|
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());
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>cartsguru</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
|
7 |
<channel>community</channel>
|
@@ -18,13 +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 |
-
- Remove additionnal fields
|
23 |
-
- Add totalATI in sent data</notes>
|
24 |
<authors><author><name>Maxime Pruvost</name><user>cgmaximepruvost</user><email>maxime@carts.guru</email></author></authors>
|
25 |
<date>2016-04-05</date>
|
26 |
-
<time>
|
27 |
-
<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="
|
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.1.4</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>- 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>
|