Version Notes
This update includes:
- fixed bug: U.S orders are set wrong region. Used Fruugo order province value to set the region_id of orders
Download this release
Release Info
Developer | inoutput.io |
Extension | Fruugo_Integration |
Version | 1.0.9 |
Comparing to | |
See all releases |
Code changes from version 1.0.8 to 1.0.9
app/code/community/Fruugo/Integration/.DS_Store
CHANGED
Binary file
|
app/code/community/Fruugo/Integration/Helper/OrdersFeedProcessor.php
CHANGED
@@ -118,6 +118,7 @@ class Fruugo_Integration_OrdersFeedProcessor extends Mage_Core_Helper_Abstract
|
|
118 |
$lastName = $shippingAddress['lastName'];
|
119 |
$streetAddress = $shippingAddress['streetAddress'];
|
120 |
$city = $shippingAddress['city'];
|
|
|
121 |
$postcode = $shippingAddress['postalCode'];
|
122 |
$countryCode = $shippingAddress['countryCode'];
|
123 |
$phoneNumber = $shippingAddress['phoneNumber'];
|
@@ -196,7 +197,7 @@ class Fruugo_Integration_OrdersFeedProcessor extends Mage_Core_Helper_Abstract
|
|
196 |
'street' => $streetAddress,
|
197 |
'city' => $city,
|
198 |
'postcode' => $postcode,
|
199 |
-
'region_id' => '
|
200 |
'telephone' => $phoneNumber,
|
201 |
'country_id' => $countryCode
|
202 |
);
|
@@ -302,6 +303,34 @@ class Fruugo_Integration_OrdersFeedProcessor extends Mage_Core_Helper_Abstract
|
|
302 |
return $arr;
|
303 |
}
|
304 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
private function _randomPassword()
|
306 |
{
|
307 |
$alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
|
118 |
$lastName = $shippingAddress['lastName'];
|
119 |
$streetAddress = $shippingAddress['streetAddress'];
|
120 |
$city = $shippingAddress['city'];
|
121 |
+
$province = $shippingAddress['province'];
|
122 |
$postcode = $shippingAddress['postalCode'];
|
123 |
$countryCode = $shippingAddress['countryCode'];
|
124 |
$phoneNumber = $shippingAddress['phoneNumber'];
|
197 |
'street' => $streetAddress,
|
198 |
'city' => $city,
|
199 |
'postcode' => $postcode,
|
200 |
+
'region_id' => empty($province) ? 'No region' : $this->getRegionIdByProvince($province, $countryCode),
|
201 |
'telephone' => $phoneNumber,
|
202 |
'country_id' => $countryCode
|
203 |
);
|
303 |
return $arr;
|
304 |
}
|
305 |
|
306 |
+
|
307 |
+
private function getRegionIdByProvince($province, $countryCode)
|
308 |
+
{
|
309 |
+
$resource = Mage::getSingleton('core/resource');
|
310 |
+
$readConnection = $resource->getConnection('core_read');
|
311 |
+
$writeConnection = $resource->getConnection('core_write');
|
312 |
+
$tablePrefix = Mage::getConfig()->getTablePrefix();
|
313 |
+
$regionTable = $tablePrefix . 'directory_country_region';
|
314 |
+
$provinceUpper = strtoupper($province);
|
315 |
+
$countryUpper = strtoupper($countryCode);
|
316 |
+
|
317 |
+
// get region if exist
|
318 |
+
$selectRegionQuery = "SELECT * FROM $regionTable WHERE UPPER(country_id) = '{$countryUpper}' AND (UPPER(default_name) ='{$provinceUpper}' OR UPPER(code) ='{$provinceUpper}')";
|
319 |
+
$regionId = $readConnection->fetchOne($selectRegionQuery);
|
320 |
+
|
321 |
+
if (!$regionId) {
|
322 |
+
// insert region
|
323 |
+
$regoinCode = strtoupper(preg_replace('/\s+/', '', $province));
|
324 |
+
$createRegionQuery = "INSERT INTO $regionTable (country_id, code , default_name) VALUES ('{$countryCode}', '{$regoinCode}', '{$province}')";
|
325 |
+
$writeConnection->query($createRegionQuery);
|
326 |
+
|
327 |
+
// get new region id
|
328 |
+
$regionId = $writeConnection->lastInsertId();
|
329 |
+
}
|
330 |
+
|
331 |
+
return $regionId;
|
332 |
+
}
|
333 |
+
|
334 |
private function _randomPassword()
|
335 |
{
|
336 |
$alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
|
app/code/community/Fruugo/Integration/etc/config.xml
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Fruugo_Integration>
|
27 |
-
<version>1.0.
|
28 |
</Fruugo_Integration>
|
29 |
</modules>
|
30 |
<global>
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Fruugo_Integration>
|
27 |
+
<version>1.0.9</version> <!-- Version number of your module -->
|
28 |
</Fruugo_Integration>
|
29 |
</modules>
|
30 |
<global>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fruugo_Integration</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/">GNU</license>
|
7 |
<channel>community</channel>
|
@@ -16,13 +16,11 @@ This plugin mainly performs two tasks:
|
|
16 |
- Read from Fruugo Rrders API periodically on a specified frequency, and notifies Magento order events to Fruugo Orders API.</description>
|
17 |
<notes>This update includes:
|
18 |

|
19 |
-
-
|
20 |
-
- Used parent title if set
|
21 |
-
- Reverted silly typing error</notes>
|
22 |
<authors><author><name>inoutput.io</name><user>inoutput</user><email>support@inoutput.io</email></author><author><name>fruugo.com</name><user>Fruugo</user><email>support@fruugo.com</email></author></authors>
|
23 |
-
<date>2016-02
|
24 |
-
<time>
|
25 |
-
<contents><target name="magecommunity"><dir name="Fruugo"><dir name="Integration"><dir name="Block"><dir name="Catalog"><dir name="Product"><file name="Tab.php" hash="412d5a38c07f78fd56e3509809038008"/></dir></dir><file name="Languagestoremapping.php" hash="7852846c2428b4fc15434a1e78a37de7"/><file name="Refreshcountriesbutton.php" hash="5a7e3af708dd470725981ec187b2c07d"/><dir name="Sales"><dir name="Order"><dir name="View"><file name="Tabs.php" hash="d98faeeede3c06d5f28f8f9731438314"/></dir></dir></dir></dir><dir name="Helper"><file name="ConfigLoader.php" hash="f930d687b44fe0a3a9e70383e0500a7c"/><file name="Data.php" hash="866fe8e1ea50749218d6efcab8454f28"/><file name="Defines.php" hash="a97616fe105332db06292c68eabecdf1"/><file name="FruugoCountriesSeeder.php" hash="68949469a1b1ce6a605fccd132e9e3c0"/><file name="Logger.php" hash="a83fdd017e59261e059a8d18d223dd59"/><file name="OrdersFeedProcessor.php" hash="
|
26 |
<compatible/>
|
27 |
<dependencies><required><php><min>5.4.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7</min><max/></package></required></dependencies>
|
28 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fruugo_Integration</name>
|
4 |
+
<version>1.0.9</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/">GNU</license>
|
7 |
<channel>community</channel>
|
16 |
- Read from Fruugo Rrders API periodically on a specified frequency, and notifies Magento order events to Fruugo Orders API.</description>
|
17 |
<notes>This update includes:
|
18 |

|
19 |
+
- fixed bug: U.S orders are set wrong region. Used Fruugo order province value to set the region_id of orders</notes>
|
|
|
|
|
20 |
<authors><author><name>inoutput.io</name><user>inoutput</user><email>support@inoutput.io</email></author><author><name>fruugo.com</name><user>Fruugo</user><email>support@fruugo.com</email></author></authors>
|
21 |
+
<date>2016-03-02</date>
|
22 |
+
<time>10:36:52</time>
|
23 |
+
<contents><target name="magecommunity"><dir name="Fruugo"><dir name="Integration"><dir name="Block"><dir name="Catalog"><dir name="Product"><file name="Tab.php" hash="412d5a38c07f78fd56e3509809038008"/></dir></dir><file name="Languagestoremapping.php" hash="7852846c2428b4fc15434a1e78a37de7"/><file name="Refreshcountriesbutton.php" hash="5a7e3af708dd470725981ec187b2c07d"/><dir name="Sales"><dir name="Order"><dir name="View"><file name="Tabs.php" hash="d98faeeede3c06d5f28f8f9731438314"/></dir></dir></dir></dir><dir name="Helper"><file name="ConfigLoader.php" hash="f930d687b44fe0a3a9e70383e0500a7c"/><file name="Data.php" hash="866fe8e1ea50749218d6efcab8454f28"/><file name="Defines.php" hash="a97616fe105332db06292c68eabecdf1"/><file name="FruugoCountriesSeeder.php" hash="68949469a1b1ce6a605fccd132e9e3c0"/><file name="Logger.php" hash="a83fdd017e59261e059a8d18d223dd59"/><file name="OrdersFeedProcessor.php" hash="cdf23b9aa5f330c20745ab15695b5050"/><file name="ProductsFeedGenerator.php" hash="2e2c74a2c7128e58d524b9c3fd2dd8d9"/><file name="ProductsFeedGeneratorProfiler.php" hash="33cbf6db6cecda919011d23432d9bdb9"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><file name="OrderCron.php" hash="8187697b999171b8940be7e5306a3bc7"/><file name="ProductCron.php" hash="a8bdd62ad14cdb85d9ef0ae2b85cecad"/></dir><dir name="Source"><file name="ExportPageSize.php" hash="a322cb1b507d33444078ba6494b461fd"/><file name="Hour.php" hash="fab1337425532af32cf8642b8b244930"/><file name="MaxErrors.php" hash="03213889323c47349b5aaa7d7b6752f5"/><file name="MaxResourcesLoad.php" hash="8b941802b5a45f2744abe83b117dceba"/><file name="ProductDescriptionType.php" hash="4a2810baeabe1a74b1b06b92cc2e4481"/><file name="SleepTimeSec.php" hash="9c9790275cf3ec3347746bee53cb50ae"/></dir></dir></dir></dir><file name="Countries.php" hash="a23378525c616fd87c5589933aec48c6"/><file name="CronJobObserver.php" hash="303c9619a9abb2489365b08c94507b31"/><file name="Observer.php" hash="1e16ebea05d59b472cc9f279965cd17e"/><file name="Payment.php" hash="4e7d2d72e7662ea71c178d85c9b9bd6c"/><dir name="Resource"><dir name="Countries"><file name="Collection.php" hash="618a95f1535d4c63724a2f7eaebf6c2b"/></dir><file name="Countries.php" hash="dc3da7aec3c3472a4ccd73e2b2f255f0"/><dir name="Shipment"><file name="Collection.php" hash="66d038f890e36403f9ffb2e283e88daf"/></dir><file name="Shipment.php" hash="d8c13444ba5089cf606241f2c7c9a87d"/></dir><file name="Shipment.php" hash="23b1c0b4bc4e29cb137c9b3819723a63"/></dir><dir name="controllers"><file name="OrdersController.php" hash="a2d9d2f4c916c376f146cfccecb4110d"/><file name="PackinglistController.php" hash="d76ac40e81f51635a073fb20492883f8"/><file name="ProductsController.php" hash="111475a85b64e4c14753f333568842ec"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/><file name=".gitignore" hash="a1d994a3c45d2cb16e44c5a311159532"/></dir><dir name="data"><dir name="fruugo_attributes_setup"><file name="data-install-0.1.1.php" hash="73a6210fdb6c5a2edfa0222a6a239e9a"/></dir><file name=".DS_Store" hash="d3071693cbf676ab90bb393a4d874cfc"/></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="integration.xml" hash="3f173b27f9f483c00b33b713c0bad737"/></dir><dir name="template"><dir name="integration"><dir name="catalog"><dir name="product"><file name="fruugo-allowed-countries.phtml" hash="066098b4583e6bd3882c01645bd9ed1d"/></dir></dir><dir name="sales"><dir name="order"><dir name="view"><dir name="tab"><file name="packinglist.phtml" hash="9ec64369d5c23043976b08573f3435dd"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="b98b2b21d0836702326e5d82289386cd"/><file name="system.xml" hash="fbc772bf4764682c912c97be3959ce12"/></dir><dir name="sql"><dir name="fruugo_attributes_setup"><file name="install-0.1.1.php" hash="326629d7305e3c3b20aaf8d97de1f17b"/></dir></dir><file name=".DS_Store" hash="2c8e8f48f57f17b51fddb66b074380aa"/><file name=".gitignore" hash="f0cb20b35e2469e9e9617f658ed452a5"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="integration.xml" hash="3f173b27f9f483c00b33b713c0bad737"/></dir><dir name="template"><dir name="integration"><dir name="catalog"><dir name="product"><file name="fruugo-allowed-countries.phtml" hash="066098b4583e6bd3882c01645bd9ed1d"/></dir></dir><dir name="sales"><dir name="order"><dir name="view"><dir name="tab"><file name="packinglist.phtml" hash="9ec64369d5c23043976b08573f3435dd"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Fruugo_Integration.xml" hash="b01dcb5088d487517bd87af216d6d7c8"/></dir></target></contents>
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.4.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7</min><max/></package></required></dependencies>
|
26 |
</package>
|