Version Notes
Bugfixes:
- fixed bug with database table prefix
- fixed bug with checking required attributes in default attribute set
Improvements:
- Changed logic of assigning categories, products assigned only to the last category in the tree
- Added ability to save data in dropdown fields as example "Brand", then it's possible to use in layered navigation
Download this release
Release Info
| Developer | IceShop |
| Extension | ice_import |
| Version | 1.6.0 |
| Comparing to | |
| See all releases | |
Code changes from version 1.5.0 to 1.6.0
app/code/community/Iceshop/Iceimport/Model/Convert/Adapter/Product.php
CHANGED
|
@@ -106,6 +106,15 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 106 |
$message = Mage::helper('catalog')->__('Skip import row, required field "%s" not defined', 'categories');
|
| 107 |
Mage::throwException($message);
|
| 108 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
$category = $iceimportAttributes['categories'];
|
| 110 |
if (empty($iceimportAttributes['unspsc'])) {
|
| 111 |
$message = Mage::helper('catalog')->__('Skip import. Category UNSPSC not defined in store');
|
|
@@ -116,8 +125,20 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 116 |
$message = Mage::helper('catalog')->__('Skip import. Category UNSPSC path not defined in store');
|
| 117 |
Mage::throwException($message);
|
| 118 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
$unspscPath = $iceimportAttributes['unspsc_path'];
|
| 120 |
-
|
|
|
|
|
|
|
|
|
|
| 121 |
// set in / out of stock
|
| 122 |
$isInStock = 0;
|
| 123 |
if (!empty($iceimportAttributes['is_in_stock'])) {
|
|
@@ -222,14 +243,15 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 222 |
// check import type (Import only price & qty or all product info)
|
| 223 |
$stockConf = (int)Mage::getStoreConfig('importprod_root/importprod/import_stock', $storeId);
|
| 224 |
$priceConf = (int)Mage::getStoreConfig('importprod_root/importprod/import_prices', $storeId);
|
|
|
|
| 225 |
$productId = $this->_coreSave($productData, $productId, $storeId, $sku, $categoryIds);
|
| 226 |
$this->_corePriceStock($websiteId, $productId, $price, $qty, $sku, $isInStock, $stockConf, $priceConf);
|
| 227 |
-
$this->_connRes->query('INSERT INTO iceshop_iceimport_imported_product_ids (product_id, product_sku) VALUES (:prod_id, :sku) ON DUPLICATE KEY UPDATE product_sku = :sku', array(':prod_id' => $productId, ':sku' => $sku));
|
| 228 |
} else {
|
| 229 |
$productId = $this->_coreSave($productData, $productId, $storeId, $sku, $categoryIds);
|
| 230 |
// add price & stock
|
| 231 |
$this->_corePriceStock($websiteId, $productId, $price, $qty, $sku, $isInStock);
|
| 232 |
-
$this->_connRes->query('INSERT INTO iceshop_iceimport_imported_product_ids (product_id, product_sku) VALUES (:prod_id, :sku) ON DUPLICATE KEY UPDATE product_sku = :sku', array(':prod_id' => $productId, ':sku' => $sku));
|
| 233 |
}
|
| 234 |
|
| 235 |
// add product image to queue
|
|
@@ -282,6 +304,44 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 282 |
|
| 283 |
return true;
|
| 284 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
|
| 286 |
protected function _coreSave(array $entityData, $productId = null, $storeId = 0, $sku, $categoryIds)
|
| 287 |
{
|
|
@@ -315,6 +375,7 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 315 |
}
|
| 316 |
}
|
| 317 |
}
|
|
|
|
| 318 |
$bindArray[':store_id'] = $storeId;
|
| 319 |
|
| 320 |
foreach ($entityData as $type => $typeAttributes) {
|
|
@@ -322,12 +383,23 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 322 |
if ($type != 'spec') {
|
| 323 |
$tailCoreSaveSQL = '';
|
| 324 |
$attributesInit = '';
|
| 325 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
if (!empty($typeAttributes)) {
|
| 327 |
$tailCoreSaveSQL .= "
|
| 328 |
INSERT INTO `" . $this->_tablePrefix . "catalog_product_entity_" . $type . "` (`entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`) VALUES ";
|
| 329 |
-
|
| 330 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
$attributesInit .= "
|
| 332 |
SELECT @" . $attribute . "_id := `attribute_id` FROM `" . $this->_tablePrefix . "eav_attribute` WHERE
|
| 333 |
`attribute_code` = '" . $attribute . "' AND entity_type_id = @product_entity_type_id;
|
|
@@ -338,7 +410,7 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 338 |
(@product_entity_type_id, @" . $attribute . "_id, :store_id, @product_id, :" . $attribute . " ), ";
|
| 339 |
$bindArray[':' . $attribute] = $value;
|
| 340 |
|
| 341 |
-
|
| 342 |
$tailCoreSaveSQL = substr($tailCoreSaveSQL, 0, -2);
|
| 343 |
$tailCoreSaveSQL .= "
|
| 344 |
ON DUPLICATE KEY UPDATE
|
|
@@ -346,13 +418,13 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 346 |
";
|
| 347 |
}
|
| 348 |
$coreSaveSQL .= $attributesInit . $tailCoreSaveSQL;
|
| 349 |
-
}
|
| 350 |
foreach ($typeAttributes as $attribute => $attributeData) {
|
| 351 |
$prod_id_field = $attributeData['prod_id_field'];
|
| 352 |
$table = $attributeData['table'];
|
| 353 |
$field = $attributeData['field'];
|
| 354 |
$value = $attributeData['value'];
|
| 355 |
-
if (!
|
| 356 |
$coreSaveSQL .= "
|
| 357 |
UPDATE `" . $this->_tablePrefix . $table . "` SET `" . $field . "` = :" . $attribute . " WHERE `" . $prod_id_field . "` = @product_id;
|
| 358 |
";
|
|
@@ -364,15 +436,24 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 364 |
// categories
|
| 365 |
$coreSaveSQL .= "INSERT INTO `" . $this->_tablePrefix . "catalog_category_product` (`category_id`, `product_id`, `position`) VALUES ";
|
| 366 |
$counter = 1;
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 370 |
$coreSaveSQL .= " (" . (int)$categoryId . ", @product_id, 1) , ";
|
| 371 |
-
} else if ($counter == count($
|
| 372 |
-
$coreSaveSQL .= " (" . (int)$categoryId . ", @product_id, 1) ON DUPLICATE KEY UPDATE `position` = 1 ";
|
| 373 |
}
|
| 374 |
$counter++;
|
| 375 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 376 |
try {
|
| 377 |
$bindArray[':' . $attribute] = $value;
|
| 378 |
|
|
@@ -749,12 +830,24 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 749 |
}
|
| 750 |
}
|
| 751 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 752 |
// map custom attributes
|
| 753 |
if (!empty($importData)) {
|
| 754 |
foreach ($importData as $attributeCode => $value) {
|
| 755 |
$backendTypeFetch = $this->_connRes->fetchRow("SELECT backend_type FROM `" . $this->_tablePrefix . "eav_attribute` WHERE `attribute_code` = :code", array(':code' => $attributeCode));
|
| 756 |
$backendType = $backendTypeFetch['backend_type'];
|
| 757 |
-
if ($backendType != 'static' && !empty($backendType) && $value != '') {
|
| 758 |
$productData[$backendType][$attributeCode] = $value;
|
| 759 |
unset($importData[$attributeCode]);
|
| 760 |
}
|
|
@@ -776,6 +869,7 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 776 |
|
| 777 |
protected function _getDefaultAttributesList()
|
| 778 |
{
|
|
|
|
| 779 |
return array(
|
| 780 |
'varchar' => array(
|
| 781 |
'gift_message_available',
|
|
@@ -785,7 +879,6 @@ class Iceshop_Iceimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model
|
|
| 785 |
'options_container',
|
| 786 |
'page_layout',
|
| 787 |
'mpn',
|
| 788 |
-
'brand_name',
|
| 789 |
'name',
|
| 790 |
'url_key',
|
| 791 |
'meta_description',
|
| 106 |
$message = Mage::helper('catalog')->__('Skip import row, required field "%s" not defined', 'categories');
|
| 107 |
Mage::throwException($message);
|
| 108 |
}
|
| 109 |
+
if (!empty($iceimportAttributes['categories'])) {
|
| 110 |
+
$cat_names = explode('/', $iceimportAttributes['categories']);
|
| 111 |
+
foreach($cat_names as $cat_name){
|
| 112 |
+
if(empty($cat_name)){
|
| 113 |
+
$message = Mage::helper('catalog')->__('Skip import row, some of categories does not have name');
|
| 114 |
+
Mage::throwException($message);
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
}
|
| 118 |
$category = $iceimportAttributes['categories'];
|
| 119 |
if (empty($iceimportAttributes['unspsc'])) {
|
| 120 |
$message = Mage::helper('catalog')->__('Skip import. Category UNSPSC not defined in store');
|
| 125 |
$message = Mage::helper('catalog')->__('Skip import. Category UNSPSC path not defined in store');
|
| 126 |
Mage::throwException($message);
|
| 127 |
}
|
| 128 |
+
if (!empty($iceimportAttributes['unspsc_path'])) {
|
| 129 |
+
$cat_unspscs = explode('/', $iceimportAttributes['unspsc_path']);
|
| 130 |
+
foreach($cat_unspscs as $cat_unspsc){
|
| 131 |
+
if(empty($cat_unspsc)){
|
| 132 |
+
$message = Mage::helper('catalog')->__('Skip import row, some of categories does not have UNSPSC');
|
| 133 |
+
Mage::throwException($message);
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
}
|
| 137 |
$unspscPath = $iceimportAttributes['unspsc_path'];
|
| 138 |
+
if(!empty($cat_unspscs) && !empty($cat_names) && count($cat_names) != count($cat_unspscs)){
|
| 139 |
+
$message = Mage::helper('catalog')->__('Skip import row, categories names does not match categories UNSPSC');
|
| 140 |
+
Mage::throwException($message);
|
| 141 |
+
}
|
| 142 |
// set in / out of stock
|
| 143 |
$isInStock = 0;
|
| 144 |
if (!empty($iceimportAttributes['is_in_stock'])) {
|
| 243 |
// check import type (Import only price & qty or all product info)
|
| 244 |
$stockConf = (int)Mage::getStoreConfig('importprod_root/importprod/import_stock', $storeId);
|
| 245 |
$priceConf = (int)Mage::getStoreConfig('importprod_root/importprod/import_prices', $storeId);
|
| 246 |
+
|
| 247 |
$productId = $this->_coreSave($productData, $productId, $storeId, $sku, $categoryIds);
|
| 248 |
$this->_corePriceStock($websiteId, $productId, $price, $qty, $sku, $isInStock, $stockConf, $priceConf);
|
| 249 |
+
$this->_connRes->query('INSERT INTO ' . $this->_tablePrefix . 'iceshop_iceimport_imported_product_ids (product_id, product_sku) VALUES (:prod_id, :sku) ON DUPLICATE KEY UPDATE product_sku = :sku', array(':prod_id' => $productId, ':sku' => $sku));
|
| 250 |
} else {
|
| 251 |
$productId = $this->_coreSave($productData, $productId, $storeId, $sku, $categoryIds);
|
| 252 |
// add price & stock
|
| 253 |
$this->_corePriceStock($websiteId, $productId, $price, $qty, $sku, $isInStock);
|
| 254 |
+
$this->_connRes->query('INSERT INTO ' . $this->_tablePrefix . 'iceshop_iceimport_imported_product_ids (product_id, product_sku) VALUES (:prod_id, :sku) ON DUPLICATE KEY UPDATE product_sku = :sku', array(':prod_id' => $productId, ':sku' => $sku));
|
| 255 |
}
|
| 256 |
|
| 257 |
// add product image to queue
|
| 304 |
|
| 305 |
return true;
|
| 306 |
}
|
| 307 |
+
public function getAttributeOptionValue($arg_attribute, $arg_value) {
|
| 308 |
+
$attribute_model = Mage::getModel('eav/entity_attribute');
|
| 309 |
+
$attribute_options_model= Mage::getModel('eav/entity_attribute_source_table') ;
|
| 310 |
+
|
| 311 |
+
$attribute_code = $attribute_model->getIdByCode('catalog_product', $arg_attribute);
|
| 312 |
+
$attribute = $attribute_model->load($attribute_code);
|
| 313 |
+
|
| 314 |
+
$attribute_table = $attribute_options_model->setAttribute($attribute);
|
| 315 |
+
|
| 316 |
+
$options = $attribute_options_model->getAllOptions(false);
|
| 317 |
+
|
| 318 |
+
foreach($options as $option) {
|
| 319 |
+
if ($option['label'] == $arg_value) {
|
| 320 |
+
return $option['value']; }
|
| 321 |
+
}
|
| 322 |
+
return false;
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
|
| 326 |
+
public function addAttributeOption($arg_attribute, $arg_value) {
|
| 327 |
+
$attribute_model = Mage::getModel('eav/entity_attribute');
|
| 328 |
+
$attribute_options_model= Mage::getModel('eav/entity_attribute_source_table') ;
|
| 329 |
+
|
| 330 |
+
$attribute_code = $attribute_model->getIdByCode('catalog_product', $arg_attribute);
|
| 331 |
+
$attribute = $attribute_model->load($attribute_code);
|
| 332 |
+
|
| 333 |
+
$attribute_table = $attribute_options_model->setAttribute($attribute);
|
| 334 |
+
$options = $attribute_options_model->getAllOptions(false);
|
| 335 |
+
|
| 336 |
+
$value['option'] = array($arg_value,$arg_value);
|
| 337 |
+
$result = array('value' => $value);
|
| 338 |
+
|
| 339 |
+
$attribute->setData('option',$result);
|
| 340 |
+
$attribute->save();
|
| 341 |
+
|
| 342 |
+
return $this->getAttributeOptionValue($arg_attribute, $arg_value);
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
|
| 346 |
protected function _coreSave(array $entityData, $productId = null, $storeId = 0, $sku, $categoryIds)
|
| 347 |
{
|
| 375 |
}
|
| 376 |
}
|
| 377 |
}
|
| 378 |
+
|
| 379 |
$bindArray[':store_id'] = $storeId;
|
| 380 |
|
| 381 |
foreach ($entityData as $type => $typeAttributes) {
|
| 383 |
if ($type != 'spec') {
|
| 384 |
$tailCoreSaveSQL = '';
|
| 385 |
$attributesInit = '';
|
| 386 |
+
if($type == 'select'){
|
| 387 |
+
$type = 'int';
|
| 388 |
+
$is_select = 1;
|
| 389 |
+
}else{
|
| 390 |
+
$is_select = 0;
|
| 391 |
+
}
|
| 392 |
if (!empty($typeAttributes)) {
|
| 393 |
$tailCoreSaveSQL .= "
|
| 394 |
INSERT INTO `" . $this->_tablePrefix . "catalog_product_entity_" . $type . "` (`entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`) VALUES ";
|
| 395 |
+
foreach ($typeAttributes as $attribute => $value) {
|
| 396 |
+
if($is_select == 1){
|
| 397 |
+
$option_id = $this->getAttributeOptionValue($attribute, $value);
|
| 398 |
+
if(empty($option_id)){
|
| 399 |
+
$option_id = $this->addAttributeOption($attribute, $value);
|
| 400 |
+
}
|
| 401 |
+
$value = $option_id;
|
| 402 |
+
}
|
| 403 |
$attributesInit .= "
|
| 404 |
SELECT @" . $attribute . "_id := `attribute_id` FROM `" . $this->_tablePrefix . "eav_attribute` WHERE
|
| 405 |
`attribute_code` = '" . $attribute . "' AND entity_type_id = @product_entity_type_id;
|
| 410 |
(@product_entity_type_id, @" . $attribute . "_id, :store_id, @product_id, :" . $attribute . " ), ";
|
| 411 |
$bindArray[':' . $attribute] = $value;
|
| 412 |
|
| 413 |
+
}
|
| 414 |
$tailCoreSaveSQL = substr($tailCoreSaveSQL, 0, -2);
|
| 415 |
$tailCoreSaveSQL .= "
|
| 416 |
ON DUPLICATE KEY UPDATE
|
| 418 |
";
|
| 419 |
}
|
| 420 |
$coreSaveSQL .= $attributesInit . $tailCoreSaveSQL;
|
| 421 |
+
}else{
|
| 422 |
foreach ($typeAttributes as $attribute => $attributeData) {
|
| 423 |
$prod_id_field = $attributeData['prod_id_field'];
|
| 424 |
$table = $attributeData['table'];
|
| 425 |
$field = $attributeData['field'];
|
| 426 |
$value = $attributeData['value'];
|
| 427 |
+
if (!emptcy($table) && !empty($field)) {
|
| 428 |
$coreSaveSQL .= "
|
| 429 |
UPDATE `" . $this->_tablePrefix . $table . "` SET `" . $field . "` = :" . $attribute . " WHERE `" . $prod_id_field . "` = @product_id;
|
| 430 |
";
|
| 436 |
// categories
|
| 437 |
$coreSaveSQL .= "INSERT INTO `" . $this->_tablePrefix . "catalog_category_product` (`category_id`, `product_id`, `position`) VALUES ";
|
| 438 |
$counter = 1;
|
| 439 |
+
|
| 440 |
+
$mapCategoryIds = array();
|
| 441 |
+
$mapCategoryIds[] = array_pop($categoryIds);
|
| 442 |
+
$delCategoryIds = array_diff($categoryIds, $mapCategoryIds);
|
| 443 |
+
|
| 444 |
+
foreach ($mapCategoryIds as $categoryId) {
|
| 445 |
+
if ($counter < count($mapCategoryIds)) {
|
| 446 |
$coreSaveSQL .= " (" . (int)$categoryId . ", @product_id, 1) , ";
|
| 447 |
+
} else if ($counter == count($mapCategoryIds)) {
|
| 448 |
+
$coreSaveSQL .= " (" . (int)$categoryId . ", @product_id, 1) ON DUPLICATE KEY UPDATE `position` = 1; ";
|
| 449 |
}
|
| 450 |
$counter++;
|
| 451 |
}
|
| 452 |
+
if(!empty($delCategoryIds)){
|
| 453 |
+
foreach ($delCategoryIds as $delCategoryId) {
|
| 454 |
+
$coreSaveSQL .= "DELETE FROM `" . $this->_tablePrefix . "catalog_category_product` WHERE `category_id` = ". (int)$delCategoryId ." AND `product_id` = @product_id;";
|
| 455 |
+
}
|
| 456 |
+
}
|
| 457 |
try {
|
| 458 |
$bindArray[':' . $attribute] = $value;
|
| 459 |
|
| 830 |
}
|
| 831 |
}
|
| 832 |
|
| 833 |
+
if (!empty($importData)) {
|
| 834 |
+
foreach ($importData as $attributeCode => $value) {
|
| 835 |
+
$frontendTypeFetch = $this->_connRes->fetchRow("SELECT frontend_input FROM `" . $this->_tablePrefix . "eav_attribute` WHERE `attribute_code` = :code", array(':code' => $attributeCode));
|
| 836 |
+
if($frontendTypeFetch['frontend_input'] == 'select'){
|
| 837 |
+
$frontendType = $frontendTypeFetch['frontend_input'];
|
| 838 |
+
if ($frontendType != 'static' && !empty($frontendType) && $value != '') {
|
| 839 |
+
$productData[$frontendType][$attributeCode] = $value;
|
| 840 |
+
unset($importData[$attributeCode]);
|
| 841 |
+
}
|
| 842 |
+
}
|
| 843 |
+
}
|
| 844 |
+
}
|
| 845 |
// map custom attributes
|
| 846 |
if (!empty($importData)) {
|
| 847 |
foreach ($importData as $attributeCode => $value) {
|
| 848 |
$backendTypeFetch = $this->_connRes->fetchRow("SELECT backend_type FROM `" . $this->_tablePrefix . "eav_attribute` WHERE `attribute_code` = :code", array(':code' => $attributeCode));
|
| 849 |
$backendType = $backendTypeFetch['backend_type'];
|
| 850 |
+
if (($backendType != 'static' && !empty($backendType) && $value != '')) {
|
| 851 |
$productData[$backendType][$attributeCode] = $value;
|
| 852 |
unset($importData[$attributeCode]);
|
| 853 |
}
|
| 869 |
|
| 870 |
protected function _getDefaultAttributesList()
|
| 871 |
{
|
| 872 |
+
|
| 873 |
return array(
|
| 874 |
'varchar' => array(
|
| 875 |
'gift_message_available',
|
| 879 |
'options_container',
|
| 880 |
'page_layout',
|
| 881 |
'mpn',
|
|
|
|
| 882 |
'name',
|
| 883 |
'url_key',
|
| 884 |
'meta_description',
|
app/code/community/Iceshop/Iceimport/Model/Dataflow/Convert/Parser/Csv.php
CHANGED
|
@@ -14,14 +14,9 @@ class Iceshop_Iceimport_Model_Dataflow_Convert_Parser_Csv extends Mage_Dataflow_
|
|
| 14 |
|
| 15 |
public function parse()
|
| 16 |
{
|
| 17 |
-
$
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
$attributeSetCollection = Mage::getModel('eav/entity_attribute_set')
|
| 21 |
-
->getCollection()
|
| 22 |
-
->setEntityTypeFilter($entityTypeId);
|
| 23 |
-
$default_attr_set = $attributeSetCollection->getData();
|
| 24 |
-
$attributes = Mage::getModel('catalog/product_attribute_api')->items($default_attr_set[0]['attribute_set_id'] );
|
| 25 |
$req_attributes = array('brand_name', 'ean', 'mpn', 'delivery_eta', 'is_iceimport');
|
| 26 |
$not_found_attr = array();
|
| 27 |
foreach($req_attributes as $req_attribute){
|
| 14 |
|
| 15 |
public function parse()
|
| 16 |
{
|
| 17 |
+
$default_attr_set_id = Mage::getModel('catalog/product')->getResource()->getEntityType()->getDefaultAttributeSetId();
|
| 18 |
+
$attributes = Mage::getModel('catalog/product_attribute_api')->items($default_attr_set_id);
|
| 19 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
$req_attributes = array('brand_name', 'ean', 'mpn', 'delivery_eta', 'is_iceimport');
|
| 21 |
$not_found_attr = array();
|
| 22 |
foreach($req_attributes as $req_attribute){
|
app/code/community/Iceshop/Iceimport/etc/config.xml
CHANGED
|
@@ -99,5 +99,24 @@
|
|
| 99 |
</run>
|
| 100 |
</iceimport>
|
| 101 |
</jobs>
|
| 102 |
-
</crontab>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
</config>
|
| 99 |
</run>
|
| 100 |
</iceimport>
|
| 101 |
</jobs>
|
| 102 |
+
</crontab>
|
| 103 |
+
<default>
|
| 104 |
+
<importprod_root>
|
| 105 |
+
<importprod>
|
| 106 |
+
<category_active>1</category_active>
|
| 107 |
+
<import_product_ean>1</import_product_ean>
|
| 108 |
+
<import_product_mpn>1</import_product_mpn>
|
| 109 |
+
<import_product_brand>1</import_product_brand>
|
| 110 |
+
<import_product_name>1</import_product_name>
|
| 111 |
+
<import_product_short_description>1</import_product_short_description>
|
| 112 |
+
<import_product_description>1</import_product_description>
|
| 113 |
+
<import_product_short_summary_description>1</import_product_short_summary_description>
|
| 114 |
+
<import_product_summary_description>1</import_product_summary_description>
|
| 115 |
+
<import_prices>1</import_prices>
|
| 116 |
+
<import_stock>1</import_stock>
|
| 117 |
+
<import_delivery_eta>1</import_delivery_eta>
|
| 118 |
+
<import_images>1</import_images>
|
| 119 |
+
</importprod>
|
| 120 |
+
</importprod_root>
|
| 121 |
+
</default>
|
| 122 |
</config>
|
app/code/community/Iceshop/Iceimport/etc/system.xml
CHANGED
|
@@ -54,6 +54,7 @@
|
|
| 54 |
<show_in_default>1</show_in_default>
|
| 55 |
<show_in_website>1</show_in_website>
|
| 56 |
<show_in_store>1</show_in_store>
|
|
|
|
| 57 |
</import_product_brand>
|
| 58 |
<import_product_name translate="label">
|
| 59 |
<label>Import product name</label>
|
| 54 |
<show_in_default>1</show_in_default>
|
| 55 |
<show_in_website>1</show_in_website>
|
| 56 |
<show_in_store>1</show_in_store>
|
| 57 |
+
<enabled>1</enabled>
|
| 58 |
</import_product_brand>
|
| 59 |
<import_product_name translate="label">
|
| 60 |
<label>Import product name</label>
|
package.xml
CHANGED
|
@@ -1,22 +1,23 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>ice_import</name>
|
| 4 |
-
<version>1.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v.3</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Import categories &amp; products</summary>
|
| 10 |
<description>This extension can use to import products with categories, multiple images and custom options from CSV file.</description>
|
| 11 |
-
<notes
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
-
|
| 15 |
-
- Changed
|
|
|
|
| 16 |
<authors><author><name>Iceshop</name><user>Iceshop</user><email>support@iceshop.nl</email></author></authors>
|
| 17 |
-
<date>
|
| 18 |
-
<time>
|
| 19 |
-
<contents><target name="magecommunity"><dir name="Iceshop"><dir name="Iceimport"><dir name="Model"><dir name="Convert"><dir name="Adapter"><file name="Product.php" hash="
|
| 20 |
<compatible/>
|
| 21 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 22 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>ice_import</name>
|
| 4 |
+
<version>1.6.0</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v.3</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Import categories &amp; products</summary>
|
| 10 |
<description>This extension can use to import products with categories, multiple images and custom options from CSV file.</description>
|
| 11 |
+
<notes>Bugfixes:
|
| 12 |
+
- fixed bug with database table prefix
|
| 13 |
+
- fixed bug with checking required attributes in default attribute set
|
| 14 |
+
Improvements:
|
| 15 |
+
- Changed logic of assigning categories, products assigned only to the last category in the tree
|
| 16 |
+
- Added ability to save data in dropdown fields as example "Brand", then it's possible to use in layered navigation</notes>
|
| 17 |
<authors><author><name>Iceshop</name><user>Iceshop</user><email>support@iceshop.nl</email></author></authors>
|
| 18 |
+
<date>2014-02-19</date>
|
| 19 |
+
<time>12:18:02</time>
|
| 20 |
+
<contents><target name="magecommunity"><dir name="Iceshop"><dir name="Iceimport"><dir name="Model"><dir name="Convert"><dir name="Adapter"><file name="Product.php" hash="7125fba31031669fb49188975581cf65"/></dir></dir><dir name="Dataflow"><dir name="Batch"><file name="Import.php" hash="90a3fdd194991e4b1a0c1e6dd2ba3db1"/></dir><dir name="Convert"><dir name="Parser"><file name="Csv.php" hash="9d655cf42f686084327f2e6de215d9fb"/></dir></dir></dir><file name="Observer.php" hash="b392ef90dec09ff51e3a0984f3523677"/><dir name="System"><dir name="Config"><file name="Categoryactivity.php" hash="c60f739b06f29e47f3098bf91bc0b8fd"/><file name="Defaulttax.php" hash="d5d3b7b5862ef1264ee4b960e8dbb627"/><file name="Imageimport.php" hash="d4f67a21d5b8731716c6246a30f7a01f"/><file name="Importdeliveryeta.php" hash="0807017f687f4adeb76129dcb7f5358c"/><file name="Importprices.php" hash="1367181841e8c93f67160dbc497fa658"/><file name="Importproductbrand.php" hash="5b210f5ae30bcd69c8215f0db15f873f"/><file name="Importproductdescription.php" hash="47e0df7a29e9eb9b35e6b9b85a94d757"/><file name="Importproductean.php" hash="4e5ba806f6c31705df6797e9703a714c"/><file name="Importproductmpn.php" hash="9dc525200e8782f9161e59ea20d97517"/><file name="Importproductname.php" hash="c9a6c970105bf3ce9a368351fa27d2d6"/><file name="Importproductshdescription.php" hash="86b361fe2a483757cbd3c37a7cd556bb"/><file name="Importproductshsudescription.php" hash="c0b75d1b619f39db30d4529cc2981652"/><file name="Importproductsudescription.php" hash="8b21d2e05ac3e8f47a6eda5380fb0f49"/><file name="Importstock.php" hash="dcd5838f2b8d21f374b621bc440d9a7c"/><file name="Lockproddetails.php" hash="66107a746bb9a50c8d74e3f27bdaaedf"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="9dd90caa78c5eeac27c8c02858b9738a"/><file name="system.xml" hash="17cbe85949a33a4eb3fa301092714fa0"/></dir><dir name="sql"><dir name="iceimport_setup"><file name="mysql4-install-1.5.0.php" hash="c90722a11b7de7d23d92f12bd37d3706"/><file name="mysql4-upgrade-0.1.0-1.5.0.php" hash="26cded28767c71f2d4945e9866b7feb0"/><file name="mysql4-upgrade-1.4.0-1.5.0.php" hash="07b4b6f1e01d253db017038bd1985170"/><file name="uninstall-old-version.php" hash="291f724845f8e62d51ccdf61baf81b37"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Iceshop_Iceimport.xml" hash="c22b6e566abee45bbb2102b3239cd6a2"/></dir></target></contents>
|
| 21 |
<compatible/>
|
| 22 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 23 |
</package>
|
