Magento – Importing Product attribute values, an alternative method

attributesdataflowimport

By default, when importing products into magento via csv file, and you want to provide values for attributes for those products, you have to enter the attribute codes in the first line of the csv file, eg:

sku,colour,brand,custom_attribute_one,custom_attribute_two, ..etc..

This is absoloutly fine if you are using only a small number of attributes in your store.

However, when you have thousands of attributes, this becomes a problem as you would need to generate x number of rows, depending on how many you are using. So, lets say 1000 attributes = at least 1001 columns in the csv.

To export data from a database to this kind of format would be a nightmare, when the data is already normalised in the database.

So, the question is whether there is a way to import a csv containing a limited number of columns as below:

sku,attribute_code,value

Baring in mind that both the products and attributes would already created in magento, and this step is just to populate the actual values of each attribute relating to each imported product.

So, an example csv might look something like:

sku,         attribute_code,            value
UE46F5500AK, i_944_display_diagonal,    46
UE46F5500AK, i_11424_hd_type,           Full HD
UE46F5500AK, i_1585_display_resolution, 1920 x 1080
UE46F5500AK, i_39_aspect_ratio,         16:9

Now, i assume this would have to be done via a custom, or adapted php or dataflow script, and creating an array and using each column eg:

array(
sku[0]
attribute_code[1]
value[2]
)

However, with very little php knowledge i wouldnt even know where to start. If anyone could point me in the right direction that would be fantastic, as i have no idea of any other way to import all the values

edit. I already use magmi for importing of products, however there doesn't seem to be the needed functionality for importing the above csv example, ie you still have to enter each attribute code at the first line, which with a huge number of attributes, is no feasible

Best Answer

The simplest way is probably to use Magmi:

http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Main_Page

This will let you update only the attributes you need to, and you can skip the ones you don't want to update or enter. So for example, if you are updating existing product, you need to only enter SKU and then at least 1 other attribute that you want updated. I think this is what you need if I understand your question correctly. If this isn't your answer, please re-word your question detailing the problem specifically.