cancel
Showing results for 
Search instead for 
Did you mean: 

[PHP] add configurable product with simple (not showing)

[PHP] add configurable product with simple (not showing)

Hello,

 

I made a php script to import 4000+ configurable products with 2+ simple associated, total 15000 (config + simple).

 

So, first I create array with ids of simple products and then I create configurable product. Every thing is filled. Image,price,... But configurable product does not appear on search or catalog.

 

I figured out, if I add simple product added to configurable product, then it appear on search and catalog.

 

Exemple:

product_type,sku,qty,name

simple,1111,5,battlefield1

simple,2222,1,battlefield2

simple,3333,2,battlefield3

config,9191,"nothing",battlefield

----- here is not appear, so i do this ----

simple,1111,5,battlefield1

----- now appear on search ----

 

simple script: http://pastebin.com/t1tEFBrZ

config script: http://pastebin.com/WPDxdzGH

 

All works fine, but is stupid.

 

Magento ver. 1.9.2.1

 

Thank you.

1 REPLY

Re: [PHP] add configurable product with simple (not showing)

That sounds about right. Your configurable products need to be not only associated to simple products, but they need to have specific attributes labeled as super attributes (attributes that are configurable, such as size/color/etc.). And your simple products need to specify a value for each of these attributes as you've noticed. This is just the way it has to be. You might want to look into advanced product import and also possibly a custom profile that lets you specify these product links (super attributes for config products, related products, associated product skus, etc.).