AvS_FastSimpleImport icon indicating copy to clipboard operation
AvS_FastSimpleImport copied to clipboard

not adding simple product to configurable after update

Open lucop1 opened this issue 10 years ago • 11 comments

hi,

if I run the first script to get the products from an XML it imports correctly the simple products and it creates the configurable product.

let's say that the second time I run the script a new simple product related to the configurable is added.

The problem is that the script doesn't add it to the main product. So I have all the time to delete the configurable and the simple products then run the script again.

lucop1 avatar May 13 '15 15:05 lucop1

Could you show us your data (sample) which you are importing? I know it's working, perhaps there is an error in the data.

avstudnitz avatar May 13 '15 17:05 avstudnitz

hello,

I have also almost the same problem. At import the simple products are not added to the config product, if I add one simple product to the conifg in the backed it works, so all config attributes are ok.

It's a dev system updated to the latest version of Magento CE.

I tried to use the array example in the documentations but the config product is not imported at all, and I don't receive any error.

The cross/upsell products are imported, images...everything else works.

One more question if I want to change the categories with the import (ex: instead of catID 1,2,3 I want to have 1,4) I have to use the Replace Behavior because with the Append i will have the product in all four categories 1,2,3,4. This will delete all complex data like cross/upsell relations. Is there a middle way to replace the given complex data but without deleteing it?

Waiting for your answer.

Thank you

Sh3rman avatar May 25 '15 13:05 Sh3rman

Hello,

I'm facing the same problem.

When I try to import the set of data provided by the documentation, all the simple products are added, the configurable product is added to Magento. But when I try associate the simple products to the configurable product nothing will happen.

All data is imported well, like the images, prices, tier prices, stock etc. The only thing that not works is the association of the simple products.

I use on both servers described below Magento CE 1.9.1.0.

I'm running at the moment a webserver with PHP Version 5.4.41 and as Server API I am using FPM/FastCGI. This is the new server.

On the old server with PHP Version 5.4.27 and Server API Apache 2.0 Handler I didn't had this problem.

$data = array(
        array(
        'sku' => 'simple1',
        '_type' => 'simple',
        '_attribute_set' => 'Default',
        '_product_websites' => 'base',
        'name' => 'Simple Product 1',
        'description' => 'Default',
        'short_description' => 'Default',
        'price' => 10,
        'weight' => 0,
        'status' => 1,
        'visibility' => 4,
        'tax_class_id' => 2,
        'qty' => 99,
        'is_in_stock' => 1,
        'color' => 'red',
    ),
    array(
        'sku' => 'simple2',
        '_type' => 'simple',
        '_attribute_set' => 'Default',
        '_product_websites' => 'base',
        'name' => 'Simple Product 2',
        'description' => 'Default',
        'short_description' => 'Default',
        'price' => 10,
        'weight' => 0,
        'status' => 1,
        'visibility' => 4,
        'tax_class_id' => 2,
        'qty' => 99,
        'is_in_stock' => 1,
        'color' => 'green',
    ),
    array(
        'sku' => 'configurable',
        '_type' => 'configurable',
        '_attribute_set' => 'Default',
        '_product_websites' => 'base',
        'price' => 10,
        'name' => 'Configurable Product',
        'description' => 'Default',
        'short_description' => 'Default',
        'status' => 1,
        'visibility' => 4,
        'tax_class_id' => 2,
        'is_in_stock' => 1,
        '_super_products_sku' => array('simple1', 'simple2'),
        '_super_attribute_code' => 'color',
    ),
);

try {
    /** @var $import AvS_FastSimpleImport_Model_Import */
    $import = Mage::getModel('fastsimpleimport/import');
    $import
        ->setUseNestedArrays(true)
        ->processProductImport($data);
} catch (Exception $e) {
    print_r($import->getErrorMessages());
};

When I run the script, no errors will occur and the import says it is completed. When I try the sample code of grouped and bundled products everything will works.

Could it be the problem is caused by the different Server API otherwise I don't have any idea why my simple products not are associated with the configurable products.

Thank you in advance.

RoySp avatar Jun 02 '15 06:06 RoySp

Hi, I think the extension needs an update, because i would say the problem is the magento version. In my case the update was on the same system with the same php/apache version: PHP 5.4.39 Apache 2.2.22.

After some tests, I found a temporary solution, until we get support about this issue:

  • I made another magento upgrade this worked until the first reindexaction

  • I tested each index to see where it breaks down

  • the problem was at the Product Flat table, so i disabled this from the backend (System->Configuration->Catalog->Catalog: Use Flat Catalog Product = No)

    After this I got a new problem: categories were not imported using nested array.

  • I have 6 nested array: _category, gallery(_media_image, _media_position), _super_attribute_code, upsell(_links_upsell_sku, _links_upsell_position)

  • The categories are not imported when I use the nested arrays for gallery and upsell, with the super_attribute has no problem

  • The solution I used was: used extra arrays(NOT nested) for categories import

Strange is on a different project with magento 1.9.0.1 and simplefastimport 0.6.0 this kind of array work with no problem.

If this works also for please write, maybe it will be easier for support.

Sh3rman avatar Jun 02 '15 07:06 Sh3rman

Hi @Sh3rman,

Thanks for your answer !

The setting for Product Flat Table was set to "Yes" in the problem shop. I changed it to "No" and everythings works again.

Roy

RoySp avatar Jun 02 '15 08:06 RoySp

Hi @RoySp,

no problem, did you have any problem with categories import, using nested array?

Can you please try it and let me know if this is working in your case. Delete first the article so you don't have the categories assigned from previews imports.

array should look like: array( 'sku' => 'configurable', '_type' => 'configurable', '_attribute_set' => 'Default', '_product_websites' => 'base', 'price' => 10, 'name' => 'Configurable Product', 'description' => 'Default', 'short_description' => 'Default', 'status' => 1, 'visibility' => 4, 'tax_class_id' => 2, 'is_in_stock' => 1, '_super_products_sku' => array('simple1', 'simple2'),

    '_super_attribute_code' => array('color'),
    '_category' => array(3,4), # category ids
    '_media_image => array( "/1061854030/68513.jpg"),  # some image you are using
'_media_attribute_id' => 82, # Mage::getSingleton('catalog/product')->getResource()->getAttribute('media_gallery')->getAttributeId()
'_media_is_disabled' => 0,
'_media_position' => array(1),
'_media_lable' => ,
    '_links_upsell_sku'  => array('some_sku'),
    '_links_upsell_position' => array(1),

),

Thx

Sh3rman avatar Jun 02 '15 09:06 Sh3rman

Hi @Sh3rman,

In my normal import I don't use the category import. But I have tried the data from the documentation for you and added the '_category' property to the import.

First I used a the root category and a sub category. But this gave me an error message that the category not exist. So I changed the array in '_category' to 2 sub categories and this worked well.

The import has added the product to the 2 categories I specified.

This is the array that I used to test the categories.

 array(
        'sku' => 'configurable',
        '_type' => 'configurable',
        '_attribute_set' => 'Default',
        '_product_websites' => 'base',
        '_category' => array(4, 249),
        'price' => 10,
        'name' => 'Configurable Product',
        'description' => 'Default',
        'short_description' => 'Default',
        'status' => 1,
        'visibility' => 4,
        'tax_class_id' => 2,
        'is_in_stock' => 1,
        '_super_products_sku' => array('simple1', 'simple2'),
        '_super_attribute_code' => 'color',
    ),

My categories tree is like this :

  • Default Category (ID:2)
    • Op = Op Artikelen (ID: 249)
    • Akties en uitgelicht (ID: 4)
      • SubSub 1
      • SubSub 2
    • Sub 1
    • Sub 2

My setting for Flat Catalog Category is set to Yes, My Flat Catalog Product is set to No

I hope you can fix your problem.

If you have other questions, or want me to try something please let me know.

Good luck !

RoySp avatar Jun 02 '15 11:06 RoySp

Hi,

the problem was when using the media and upselling nested arrays:

'_media_image => array( "/1061854030/68513.jpg"), # some image you are using '_media_attribute_id' => 82, # Mage::getSingleton('catalog/product')->getResource()->getAttribute('media_gallery')->getAttributeId() '_media_is_disabled' => 0, '_media_position' => array(1), '_media_lable' => ,

'_links_upsell_sku' => array('some_sku'), '_links_upsell_position' => array(1),

Sh3rman avatar Jun 05 '15 14:06 Sh3rman

Same here: Running my import script didn't associate the simple products with the configurable product.

Disabling flat catalog products did the trick.

Although I'd prefer to call my import script regularly by cron, but since I need to enable the flat DB this is no option as long as there's no fix for this.

qx54 avatar May 09 '16 07:05 qx54

@phrench Maybe you can make a script that run the index process and disable flat DB after the import cronjob has finished?

RoySp avatar May 12 '16 09:05 RoySp

@RoySp I'm not a coder, thus my limited programming skills won't allow to make such a script.

qx54 avatar May 13 '16 16:05 qx54