/** * Set valid attribute set and product type to rows with all scopes * to ensure that existing products doesn't changed. * * @param array $rowData * @return array */ protected function _prepareRowForDb(array $rowData) { $rowData = parent::_prepareRowForDb($rowData); static $lastSku = null; if (Mage_ImportExport_Model_Import::BEHAVIOR_DELETE == $this->getBehavior()) { return $rowData; } if (self::SCOPE_DEFAULT == $this->getRowScope($rowData)) { $lastSku = $rowData[self::COL_SKU]; } if (isset($this->_oldSku[$lastSku])) { $rowData[self::COL_ATTR_SET] = $this->_newSku[$lastSku]['attr_set_code']; $rowData[self::COL_TYPE] = $this->_newSku[$lastSku]['type_id']; } return $rowData; }
/** * Set valid attribute set and category type to rows with all scopes * to ensure that existing Categories doesn't changed. * * @param array $rowData * @return array */ protected function _prepareRowForDb(array $rowData) { $rowData = parent::_prepareRowForDb($rowData); if (Mage_ImportExport_Model_Import::BEHAVIOR_DELETE == $this->getBehavior()) { return $rowData; } if (self::SCOPE_DEFAULT == $this->getRowScope($rowData)) { $rowData['name'] = $this->_getCategoryName($rowData); if (!isset($rowData['position'])) { $rowData['position'] = 10000; } // diglin - prevent warning message } return $rowData; }