Version Notes
Fixed issue with loading child rows and parent is invalid.
Download this release
Release Info
Developer | FarApp |
Extension | FarApp_Connector |
Version | 1.2.3 |
Comparing to | |
See all releases |
Code changes from version 1.2.2 to 1.2.3
app/code/community/FarApp/Connector/Model/Import/Entity/.Order.php.swp
DELETED
Binary file
|
app/code/community/FarApp/Connector/Model/Import/Entity/Product.php
CHANGED
@@ -281,4 +281,85 @@ class FarApp_Connector_Model_Import_Entity_Product extends Mage_ImportExport_Mod
|
|
281 |
}
|
282 |
return $this;
|
283 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
}
|
281 |
}
|
282 |
return $this;
|
283 |
}
|
284 |
+
|
285 |
+
public function validateRow(array $rowData, $rowNum)
|
286 |
+
{
|
287 |
+
static $sku = null; // SKU is remembered through all product rows
|
288 |
+
if (isset($this->_validatedRows[$rowNum])) { // check that row is already validated
|
289 |
+
return !isset($this->_invalidRows[$rowNum]);
|
290 |
+
}
|
291 |
+
$this->_validatedRows[$rowNum] = true;
|
292 |
+
if (isset($this->_newSku[$rowData[self::COL_SKU]])) {
|
293 |
+
$this->addRowError(self::ERROR_DUPLICATE_SKU, $rowNum);
|
294 |
+
return false;
|
295 |
+
}
|
296 |
+
$rowScope = $this->getRowScope($rowData);
|
297 |
+
// BEHAVIOR_DELETE use specific validation logic
|
298 |
+
if (Mage_ImportExport_Model_Import::BEHAVIOR_DELETE == $this->getBehavior()) {
|
299 |
+
if (self::SCOPE_DEFAULT == $rowScope && !isset($this->_oldSku[$rowData[self::COL_SKU]])) {
|
300 |
+
$this->addRowError(self::ERROR_SKU_NOT_FOUND_FOR_DELETE, $rowNum);
|
301 |
+
return false;
|
302 |
+
}
|
303 |
+
return true;
|
304 |
+
}
|
305 |
+
$this->_validate($rowData, $rowNum, $sku);
|
306 |
+
if (self::SCOPE_DEFAULT == $rowScope) { // SKU is specified, row is SCOPE_DEFAULT, new product block begins
|
307 |
+
$this->_processedEntitiesCount ++;
|
308 |
+
$sku = $rowData[self::COL_SKU];
|
309 |
+
if (isset($this->_oldSku[$sku])) { // can we get all necessary data from existant DB product?
|
310 |
+
// check for supported type of existing product
|
311 |
+
if (isset($this->_productTypeModels[$this->_oldSku[$sku]['type_id']])) {
|
312 |
+
$this->_newSku[$sku] = array(
|
313 |
+
'entity_id' => $this->_oldSku[$sku]['entity_id'],
|
314 |
+
'type_id' => $this->_oldSku[$sku]['type_id'],
|
315 |
+
'attr_set_id' => $this->_oldSku[$sku]['attr_set_id'],
|
316 |
+
'attr_set_code' => $this->_attrSetIdToName[$this->_oldSku[$sku]['attr_set_id']]
|
317 |
+
);
|
318 |
+
} else {
|
319 |
+
$this->addRowError(self::ERROR_TYPE_UNSUPPORTED, $rowNum);
|
320 |
+
$sku = false; // child rows of legacy products with unsupported types are orphans
|
321 |
+
}
|
322 |
+
} else { // validate new product type and attribute set
|
323 |
+
if (!isset($rowData[self::COL_TYPE])
|
324 |
+
|| !isset($this->_productTypeModels[$rowData[self::COL_TYPE]])
|
325 |
+
) {
|
326 |
+
$this->addRowError(self::ERROR_INVALID_TYPE, $rowNum);
|
327 |
+
} elseif (!isset($rowData[self::COL_ATTR_SET])
|
328 |
+
|| !isset($this->_attrSetNameToId[$rowData[self::COL_ATTR_SET]])
|
329 |
+
) {
|
330 |
+
$this->addRowError(self::ERROR_INVALID_ATTR_SET, $rowNum);
|
331 |
+
} elseif (!isset($this->_newSku[$sku])) {
|
332 |
+
$this->_newSku[$sku] = array(
|
333 |
+
'entity_id' => null,
|
334 |
+
'type_id' => $rowData[self::COL_TYPE],
|
335 |
+
'attr_set_id' => $this->_attrSetNameToId[$rowData[self::COL_ATTR_SET]],
|
336 |
+
'attr_set_code' => $rowData[self::COL_ATTR_SET]
|
337 |
+
);
|
338 |
+
}
|
339 |
+
}
|
340 |
+
if (isset($this->_invalidRows[$rowNum])) {
|
341 |
+
// mark SCOPE_DEFAULT row as invalid for future child rows
|
342 |
+
$sku = false;
|
343 |
+
}
|
344 |
+
} else {
|
345 |
+
if (null === $sku) {
|
346 |
+
$this->addRowError(self::ERROR_SKU_IS_EMPTY, $rowNum);
|
347 |
+
} elseif (false === $sku) {
|
348 |
+
$this->addRowError(self::ERROR_ROW_IS_ORPHAN, $rowNum);
|
349 |
+
} elseif (self::SCOPE_STORE == $rowScope && !isset($this->_storeCodeToId[$rowData[self::COL_STORE]])) {
|
350 |
+
$this->addRowError(self::ERROR_INVALID_STORE, $rowNum);
|
351 |
+
}
|
352 |
+
}
|
353 |
+
if (!isset($this->_invalidRows[$rowNum])) {
|
354 |
+
// set attribute set code into row data for followed attribute validation in type model
|
355 |
+
$rowData[self::COL_ATTR_SET] = $this->_newSku[$sku]['attr_set_code'];
|
356 |
+
$rowAttributesValid = $this->_productTypeModels[$this->_newSku[$sku]['type_id']]->isRowValid(
|
357 |
+
$rowData, $rowNum, !isset($this->_oldSku[$sku])
|
358 |
+
);
|
359 |
+
if (!$rowAttributesValid && self::SCOPE_DEFAULT == $rowScope) {
|
360 |
+
$sku = false; // mark SCOPE_DEFAULT row as invalid for future child rows
|
361 |
+
}
|
362 |
+
}
|
363 |
+
return !isset($this->_invalidRows[$rowNum]);
|
364 |
+
}
|
365 |
}
|
app/code/community/FarApp/Connector/etc/config.xml
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
<config>
|
10 |
<modules>
|
11 |
<FarApp_Connector>
|
12 |
-
<version>1.2.
|
13 |
</FarApp_Connector>
|
14 |
</modules>
|
15 |
<global>
|
9 |
<config>
|
10 |
<modules>
|
11 |
<FarApp_Connector>
|
12 |
+
<version>1.2.3</version>
|
13 |
</FarApp_Connector>
|
14 |
</modules>
|
15 |
<global>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>FarApp_Connector</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.farapp.com/p/farapp-subscription-form">Commercial</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Connector to sync product data from FarApp to Magento. FarApp currently supports NetSuite and other backends.</summary>
|
10 |
<description>FarApp is a cloud-based solution for posting product data to storefronts, retrieving orders from storefront and posting fulfillments to storefronts. We support various backends including NetSuite, X-Cart, 3D-Cart, and more. This connector allows full product data posting to Magento from FarApp. It has the the extra benefits of allowing FarApp to dynamically push new product data, automatically creating new attribute options and importing external images (features not provided by Magento).</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>FarApp</name><user>FarApp</user><email>support@farapp.com</email></author></authors>
|
13 |
-
<date>2015-
|
14 |
-
<time>22:
|
15 |
-
<contents><target name="magecommunity"><dir name="FarApp"><dir name="Connector"><dir name="Model"><dir name="Export"><dir name="Adapter"><file name="Abstract.php" hash="765dc8fbab996f17b9f049cc8aa906a0"/><file name="Array.php" hash="6ca62c702dcb9512ec429563ac1ce1a2"/></dir><dir name="Entity"><file name="Order.php" hash="14a2f735cf8fc5e8f2bcd6682a1e56b1"/></dir></dir><file name="Export.php" hash="01643ef101731c6d98bbc523642f95a0"/><dir name="Import"><dir name="Entity"><file name="Customer.php" hash="376978f635c73605d428037cca8cf594"/><file name="Order.php" hash="38579396825a1bd3ad59de84278085f6"/><file name="Product.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>5.7.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>FarApp_Connector</name>
|
4 |
+
<version>1.2.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.farapp.com/p/farapp-subscription-form">Commercial</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Connector to sync product data from FarApp to Magento. FarApp currently supports NetSuite and other backends.</summary>
|
10 |
<description>FarApp is a cloud-based solution for posting product data to storefronts, retrieving orders from storefront and posting fulfillments to storefronts. We support various backends including NetSuite, X-Cart, 3D-Cart, and more. This connector allows full product data posting to Magento from FarApp. It has the the extra benefits of allowing FarApp to dynamically push new product data, automatically creating new attribute options and importing external images (features not provided by Magento).</description>
|
11 |
+
<notes>Fixed issue with loading child rows and parent is invalid.</notes>
|
12 |
<authors><author><name>FarApp</name><user>FarApp</user><email>support@farapp.com</email></author></authors>
|
13 |
+
<date>2015-09-01</date>
|
14 |
+
<time>22:51:57</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="FarApp"><dir name="Connector"><dir name="Model"><dir name="Export"><dir name="Adapter"><file name="Abstract.php" hash="765dc8fbab996f17b9f049cc8aa906a0"/><file name="Array.php" hash="6ca62c702dcb9512ec429563ac1ce1a2"/></dir><dir name="Entity"><file name="Order.php" hash="14a2f735cf8fc5e8f2bcd6682a1e56b1"/></dir></dir><file name="Export.php" hash="01643ef101731c6d98bbc523642f95a0"/><dir name="Import"><dir name="Entity"><file name="Customer.php" hash="376978f635c73605d428037cca8cf594"/><file name="Order.php" hash="38579396825a1bd3ad59de84278085f6"/><file name="Product.php" hash="b1b6b5cbbd4799889ff87e06e38567e8"/><file name="minVersion2.php" hash="8df670fd68516ba1629304ae8ab6c812"/></dir></dir><file name="Import.php" hash="5f226d5505bf8e258a4e61f43b09b25a"/><dir name="Order"><dir name="Invoice"><file name="Api.php" hash="f133255dae51ab9c44c71ca9cc702d0a"/></dir></dir></dir><dir name="controllers"><file name="ExportController.php" hash="c51395789ff9eed363f20d5ab08ff528"/><file name="ImportController.php" hash="ec66abaf46073b9491889a199d665992"/><file name="IndexController.php" hash="93918848d3ce7f6ad05688f89a730e75"/></dir><dir name="etc"><file name="api.xml" hash="25b50336e5bfbd139eeb81bbf321dd78"/><file name="config.xml" hash="6e7c44e640d63becfbb097414d3a1376"/><file name="wsdl.xml" hash="831bf87f9939132a9d9be6327d1b6a8e"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="FarApp_Connector.xml" hash="ff3fe315c70239229cb5ff3a49d40967"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>5.7.0</max></php></required></dependencies>
|
18 |
</package>
|