Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Configurable Products? 
 
dp7777
Jr. Member
 
Total Posts:  30
Joined:  2008-08-18
 

can anyone confirm if these workarounds work in Magento version 1.1.6.

I have tried every combination of methods on this post and no luck.

I just cannot get the simple products to appear in the “Super product attributes configuration” part of the associated products for the configurable product.

I’m sure i’m following the instructions correctly but no joy.

If someone has any good ideas to try i’d love to hear them.

Thanks for all your help.

DP

 
Magento Community Magento Community
Magento Community
Magento Community
 
joyously
Guru
 
Total Posts:  447
Joined:  2008-08-21
 

@danieln:
Your code seems backwards to me. If the productId exists, it’s not new.

@dp7777:
I’ve been out of town and doing other things, so I haven’t tried the import since I upgraded to 1.1.6.  But I had to examine the changes made in 1.1.6 intimately because I didn’t have my stuff separate.... (oops) ... and I didn’t see anything that would change how the import works since 1.1.3 which is where I was testing before.
Sorry, I don’t know what else to tell you to try.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael Clegg
Jr. Member
 
Total Posts:  3
Joined:  2008-10-06
 

I’ve just managed to successfully import configurable products with the links to their associated simple products. Thanks to joyously and danieln for your code and advice, I followed your tips and it all worked brilliantly. It took some time—but it worked!

I also managed to get the products and attributes to show up on the front end (without having to manually save them or use an SQL query). The trick seems to be that you need to specify a “websites” value in your CSV file. I set it to “base” for all my products, and this solved the problem. Of course “has_options” and “required_options” both need to be set to 1 as well , but this wasn’t taking effect until I tried setting the “websites” value.

Please give it a try and let me know how you get on. I’m using version 1.1.6 BTW.

Thanks to everyone for your help on this thread!

Cheers,
Mike.

 
Magento Community Magento Community
Magento Community
Magento Community
 
David Oliver
Sr. Member
 
Avatar
Total Posts:  177
Joined:  2008-04-16
Cologne, Germany
 

Thanks for the post Mike. I may be trying this out soon.

 
Magento Community Magento Community
Magento Community
Magento Community
 
JSTRAT
Jr. Member
 
Total Posts:  16
Joined:  2008-05-06
 

@Michael Clegg

Mike, I have tried your suggestion but have had no success with it, my products still do not show their options. Would it be possible for you to send me an example of a product you imported so I can compare the csv/xml that I have used to yours. There may be a dependancy on certain columns being in the import to get this to work. I am using 1.1.6 as well.

It is vital that this is resolved otherwise I am going to have a hard time defending the development process of Magento when this is still not working after so many update releases.

Many thanks
Jason

UPDATE My template set only had option container 2 being displayed, and the option_container attribute was either not being imported or being set to container1 by default. Which is opposite to the products created in the admin console. Anyway by either updating or adding this attribute to the catalog_product_entity_varchar table I was able to get the options to display in the frontend. I still need to do some more testing to work out exactly what is happening, but this appears to be the right area to solve the problem for me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael Clegg
Jr. Member
 
Total Posts:  3
Joined:  2008-10-06
 

Have attached some files to give an idea of what worked for me. I hope this can help others who have been following this topic, but might have had some bad luck with their importing somewhere along the line! I was setting up a shoe store, so just needed multiple sizes for each shoe. You may be doing something more complex of course, but perhaps this can get you going in the right direction…

CSV file: This example file only has one shoe, made up of 9 simple and 2 configurable. (The 2 config ones are pretty much identical, just with different images as this shoe has multiple pics).  BTW - make sure the config prods are below the simple prods, or the linking won’t work!

Import Profile: You’ll have to set up an Advanced Profile in the Magento admin. This one worked for me.

Productwithlinks.php: This file needs to go in: /app/code/core/Mage/Catalog/Model/Convert/Adapter/Productwithlinks.php
It’s just a copy of: /app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php, but with code changes mentioned by clever people earlier in this thread.

Can’t guarantee that this will work correctly for everyone, but it solved my problem. Hope it helps!

Mike.

File Attachments
Import_Profile.xml  (File Size: 1KB - Downloads: 2137)
Productwithlinks.php  (File Size: 12KB - Downloads: 1667)
Product_Amber.csv.txt  (File Size: 3KB - Downloads: 2236)
 
Magento Community Magento Community
Magento Community
Magento Community
 
sheilas
Jr. Member
 
Total Posts:  16
Joined:  2007-11-14
 

it works, but only with attributes i have added manually. is this correct. i thougt non existing attributes will be added through the script.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Discovery
Enthusiast
 
Total Posts:  767
Joined:  2007-12-29
 

Works a treat - great work, that has saved me much time.

@sheila - I don’t think Magento automatically creates attributes for you nowadays on imports although I am sure it did once. I used phpmyadmin to manually add those in, however, srinigie (?) has posted a script that does the job for you, the link I don’t have to hand but is out there.

 
Magento Community Magento Community
Magento Community
Magento Community
 
GideonNewell
Jr. Member
 
Total Posts:  7
Joined:  2008-09-17
 

@Michael Clegg - Thanks for all the hard work! Sadly, my simple products aren’t showing up in the frontend even after following the examples you attached. I edited your Import_Profile with the filename of my CSV and uploaded Productwithlinks.php into the proper directory. Running the Import brings all of my products into the Magento Admin’s Product List, they just aren’t properly associated. I wonder if the problem is that I have multiple config_attributes (your CSV only had one)?

 
Magento Community Magento Community
Magento Community
Magento Community
 
joyously
Guru
 
Total Posts:  447
Joined:  2008-08-21
 

I’ve finally got some real data to import! But when I try to run my version of the import (Productwithlinks), I get the message that it can’t find the adapter by that name.
I checked and it’s still there in the code directory.
I don’t know what happened. I was running it fine on 1.1.3, upgraded to 1.1.6, went away for awhile, now it doesn’t work. But other people have gotten it to work on 1.1.6 and I had it working before… I’m not sure what to try…

UPDATE: I couldn’t get any of the files I created as adapters to work (it would parse my data file and then say it couldn’t find the adapter specified), so I put my changes into the a local copy of the normal import adapter. It worked just fine, like in my tests. All the simples were associated to the configurables, they all show up on the front end, all the related products show up, and the up-sells show up. No problems once my adapter actually got executed.  This is on 1.1.6.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Quiddity
Jr. Member
 
Total Posts:  22
Joined:  2008-06-13
 

Thanxs for the script, works like a charm.

 
Magento Community Magento Community
Magento Community
Magento Community
 
hearsay
Member
 
Total Posts:  72
Joined:  2008-08-04
 

So the two configurable product lines Michael has in his Product_Amber.csv file is actually one configurable product with two images, yes? Is this how you import products with multiple images?

Also, can I use this tool to import configurable products and their simple products and have more than one config_attribute? The store I’m working on has several attributes of the simple products that are used to create the configurable product, not just one. Can this be done?

 
Magento Community Magento Community
Magento Community
Magento Community
 
joyously
Guru
 
Total Posts:  447
Joined:  2008-08-21
 
hearsay - 14 November 2008 03:59 PM

So the two configurable product lines Michael has in his Product_Amber.csv file is actually one configurable product with two images, yes? Is this how you import products with multiple images?

Also, can I use this tool to import configurable products and their simple products and have more than one config_attribute? The store I’m working on has several attributes of the simple products that are used to create the configurable product, not just one. Can this be done?

I haven’t tried it, but supposedly you can add more images by just adding more columns with the same name (Image, small_image, whatever it’s called) and it will load multiple images.

Yes, this code works with multiple configurable attributes. My products have two. Just separate them with commas in one column.
It’s best to have your simple products loaded before the configurables, so they can be looked up. Put the simples at the beginning of the file.

 
Magento Community Magento Community
Magento Community
Magento Community
 
e-nition
Jr. Member
 
Total Posts:  4
Joined:  2008-04-22
 

I too have many, many configurable items that i need to import. I have done the following:

Added two new fields to the end of each configurable item - associated and config_attributes.

All of my config attributes use color and size.

I have added and advanced import profile:

<action type="dataflow/convert_adapter_io" method="load">
    <var 
name="type">file</var>
    <var 
name="path">var/import</var>
    <var 
name="filename"><![CDATA[import_file.csv]]></var>
    <var 
name="format"><![CDATA[csv]]></var>
</
action>

<
action type="dataflow/convert_parser_csv" method="parse">
    <var 
name="delimiter"><![CDATA[,]]></var>
    <var 
name="enclose"><![CDATA["]]></var>
    <var name="
fieldnames">true</var>
    <var name="
store"><![CDATA[0]]></var>
    <var name="
number_of_records">1</var>
    <var name="
decimal_separator"><![CDATA[.]]></var>
    <var name="
adapter">catalog/convert_adapter_productwithlinks</var> 
    <var name="
method">parse</var>
</action>

I have uploaded the attach Productwithlink.php file to /app/code/core/Mage/Catalog/Model/Convert/Adapter - this file is one supplied above.

I go to run the import and the following error is returned on every item import:

Recoverable ErrorArgument 1 passed to Mage_Catalog_Model_Product_Type_Configurable::canUseAttribute() must be an instance of Mage_Eav_Model_Entity_Attributeboolean givencalled in /app/code/core/Mage/Catalog/Model/Convert/Adapter/Productwithlinks.php on line 113 and defined in /app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php on line 78

line 112-117 is

$attribute $product->getResource()->getAttribute($attributeCode);
                if (
$product->getTypeInstance()->canUseAttribute($attribute)) {
                    
if ($new// fix for duplicating attributes error
                        
$usingAttributeIds[] $attribute->getAttributeId();
                    
}
                }

Once this has finished only simple items are visible in the product list.

Can anyone help?????

File Attachments
Productwithlinks.php  (File Size: 12KB - Downloads: 157)
 
Magento Community Magento Community
Magento Community
Magento Community
 
e-nition
Jr. Member
 
Total Posts:  4
Joined:  2008-04-22
 

I have fixed this.. i spelt colour wrong.

Problem i have now is that non of the simple products become linked to the configurable item. There are entries in the catalog_product_super_link table but nothing shows up under the configurable items associated tab. I can’t even search for them using the filter on the page.

Here is what i end up with:

Configurable Product with id: 285
3 x Simple Products with ids: 282, 283, 284

The catalog_product_super_link looks like this:

link_id       product_id       parent_id
57               282               285 
58               283               285 
59               284               285

Where else should i check?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top