3

I'm using https://github.com/avstudnitz/AvS_FastSimpleImport extension to create new simple products programmatically and then assign them to existing configurable product. Problem is I can assign single SKU but can't assign several at once with error "Product with specified super products SKU not found"

<?php

// Trying to assign several simples at once
// either $simples as comma-separated SKU or an array() doesn't work

$assignProducts[] = array(
    'sku' => $configurableProduct->getSku(),
    '_type' => '',
    '_attribute_set' => '',
    '_super_products_sku' => $simples
);

Is the only way to do it is to pass each SKU separately to Mage::getSingleton('fastsimpleimport/import')->processProductImport()?

Anyone faced this task?

0
1

If $simples is an array that's not going to work, you'd need to create several rows:

$assignProducts[] = array(
    'sku' => $configurableProduct->getSku(),
    '_type' => '',
    '_attribute_set' => '',
    '_super_products_sku' => 'sku1'
);
$assignProducts[] = array(
    '_super_products_sku' => 'sku2'
);

There was an issue about this exact same problem yesterday, please have a look at: https://github.com/avstudnitz/AvS_FastSimpleImport/issues/9

1
  • Works perfectly, thanks again :) I looked at the export csv format, but didn't figure how to do it without specifying the required attributes – Zifius Feb 22 '13 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.