AvS_FastSimpleImport icon indicating copy to clipboard operation
AvS_FastSimpleImport copied to clipboard

"Use default value" with category: how?

Open ZaneCEO opened this issue 7 years ago • 0 comments

Hi, I'm experiencing a problem similar to https://github.com/avstudnitz/AvS_FastSimpleImport/issues/402 , but this time is with categories.

I'm trying to import a category array where:

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

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

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

‌‌$arrAvS
‌array (
  0 => 
  array (
    '_root' => 'Default Category',
    'is_active' => 'yes',
    'include_in_menu' => 'yes',
    'available_sort_by' => NULL,
    'default_sort_by' => 'position',
    'display_mode' => 'static block only',
    'code_category' => 'D',
    '_category' => 'My category',
    'url_key' => 'my-cat',
    'meta_title' => 'DEFAULT: meta-title',
    'meta_description' => 'DEFAULT: meta-descr',
    'description' => 'DEFAULT: descr',
  ),
  1 => 
  array (
    '_store' => 'it',
    'name' => 'IT: name',
    'url_key' => 'it-slug',
    'meta_title' => 'ITA: meta-title',
    'meta_description' => 'ITA: meta-descr',
    'description' => 'ITA: descr',
  ),
  2 => 
  array (
    '_store' => 'en',
    'meta_title' => 'EN: meta-title',
    'meta_description' => 'EN: meta-descr',
    'name' => 'EN: name',
    'url_key' => 'en-slug',
    'description' => 'EN: description',
  ),
)

Again, this works as expected.

The problem occurs when I want to set the store value to Use default value. For example, i change the second array from 'name' => 'EN: name', to 'name' => '###EMPTY###' (description also). In this scenario, the name|description fields in the EN storeview simply get set to empty

Screenshot

The importing code is:

$import = Mage::getModel('fastsimpleimport/import');
$import->processCategoryImport($arrAvS);

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!


One more example:

        $data = array();
        $data[] = array(
            '_root' => 'Default Category',
            '_category' => 'Myyy Category',
            'description' => 'Myyy Category Description',
            'is_active' => 'yes',
            'include_in_menu' => 'yes',
            'meta_description' => 'Myyy Category Meta',
            'available_sort_by' => 'position',
            'default_sort_by' => 'position',
        );

        $data[] = array(
            '_store' => 'en',
            'name' => 'I don't want to put a custom text here, must use default',
            'description' => 'Myyy Category EN DESCR'
        );


        $this->import
            ->processCategoryImport($data);

To use default for name, I changed the second element to:

'name' => false

nope, still do not use default, displays empty text

'name' => null,

nope

'name' => Mage::getStoreConfig('fastsimpleimport/general/symbol_for_clear_field')

nope

I'm fresh out of ideas, thanks

ZaneCEO avatar Aug 24 '17 16:08 ZaneCEO