avstudnitz / AvS_FastSimpleImport

Wrapper for Magento ImportExport functionality, which imports products and customers from arrays
306 stars 146 forks source link

'name' => '###EMPTY###' disables the product on the specific storeview? #402

Closed ZaneCEO closed 7 years ago

ZaneCEO commented 7 years ago

Hi, I'm trying to import a product array where:

Index 0: the default scope Index 1: values for the it store Index 1: values for the en store

The goal is to set Use default for the ###EMPTY### values.

This is my array, and it works like a charm:

$arrAvS = 

‌array (
  0 => 
  array (
... snip ....
    '_type' => 'simple',
    'status' => 1,
    'price' => '12.56',
    'name' => 'Default name of the product',
    'description' => 'Default product description',
... snip ....
  ),
  1 => 
  array (
    '_store' => 'it',
... snip ....
  ),
  2 => 
  array (
    'sku' => NULL,
    '_store' => 'en',
    'special_price' => '18.52',
    'name' => 'My english name', //!!!please note this!!!
    'description' => '###EMPTY###',
    'short_description' => '###EMPTY###',
    'meta_description' => '###EMPTY###',
    'url_key' => '###EMPTY###',
    'price' => '###EMPTY###',
  ),
)

Again, this works as expected and each ###EMPTY### value simply becomes Use default.

The problem occurs when I change 'name' => 'My english name' and the 2nd array item becomes 'name' => '###EMPTY###'.

In this scenario, the product get disabled on the english website:

Screenshot

The importing code is:

            $import = Mage::getModel('fastsimpleimport/import');
            $import
                ->setUseNestedArrays(true)
                ->processProductImport($arrAvS);

Edit: if I re-activate via admin the product on the eng storeview, the config is perfect and the title is set to Use default as expected. The only issue is really the product being disabled then!

Admin config:

Screenshot

The store is a july-SUPEE patched Magento ver. 1.9.2.4.

AvS is 0.7.1.

Any help is greatly appreciated, thanks!

ZaneCEO commented 7 years ago

Goddamnit, my array was just missing _product_websites when the title was empty. Nothing to do with AvS then.