Is there anyone who has experience with this module in importing attributes and multiple attributes into Ubercart, I've had zero success thus far, albeit very successful with multiple images and categories import.

This wonderful module could do with some documentation on mapping out attributes and other UC fields, which I will happily contribute towards as my recent adventure with this module could help the many hundreds of people with their importing of products into Ubercart.

Comments

lokolo’s picture

I´m also looking for a solution to import attributes...

alimbert’s picture

Has anyone found any documentation for importing attributes?

code-brighton’s picture

I'm also looking for some documentation or an example csv to import products with attributes. It looks like there is code in the module to handle them, but I have no idea how to format the CSV. Please help.

goodeit’s picture

Here's a crack at explaining how to import attributes:

  1. Create an importer (at admin/structure/feeds/create). Or try my default importer module, which creates a csv importer from all Ubercart fields - including attributes - automatically. If you use it, please leave feedback on the issue!
  2. Download the template from the import page (if you use the default importer above, it will be at /import/uc_feeds_product_importer/template)
  3. Fill in the template. For each attribute option you want enabled, fill in at least one of the cells for weight, price, or cost (a zero value works). If you fill in at least one of the three, any unfilled will default to zero. If you leave all three blank, that option will not be enabled on the imported product.
  4. Import the completed csv at /import/uc_feeds_product_importer (if you're using my module above), otherwise go to /import and choose the importer you created.

As an example, consider a site that has product nodes with an attribute of Color, with options Blue, Red, and Green. Attached is a spreadsheet to create three products: one with all options, one with only blue, and one with red and green (for $2 extra). I am only using the Attribute-Option-Price cells, but you could fill in the -Cost or -Weight columns (or any combination of the three) to enable the options. Obviously, if you want to charge extra for an option, you have to use the -Price mapping.

Hopefully this will get you started importing attributes. I'm sorry if any of it is unclear, just ask questions and I can clarify.

code-brighton’s picture

Assigned: Unassigned » goodeit

Thank you so much for this explanation and your module goodeit. This worked like a dream!

Note for anyone trying this once you have completed step 2 and 3 (if you use the module) then you will need to goto /import/uc_feeds_product_importer to import your completed CSV

goodeit’s picture

@code-brighton: haha wow, I can't believe I left out that last step. I've added it to my post, thanks! And thanks for letting me know the module worked for you.

code-brighton’s picture

One problem I did have with the importer is when I'm importing a product that needs to go into more than one categories in the catalog this used to work for me with the standard uc_feeds importer when I put for example cat1,cat2,cat3 in the Catalog column then the product would appear under all 3 categories. With this importer a new category is created called "cat1,cat2,cat3"
Any ideas what might be happening here?

goodeit’s picture

@code-brighton: Did you by any chance have another module that took care of that for you? It looks like Feeds Tamper offers that exact functionality. I'm not aware of any code in uc_feeds that handles separating categories; I think you could do something like that inside hook_feeds_after_parse().

It's also possible that the default importer sets up the taxonomy mapping differently than your original importer did... would you mind exporting your original importer (or a demo one that works as you describe above) and sending it to me in a PM? I'll compare and see if I can get the default importer to have the same behavior.

for my reference: http://drupal.org/node/1301604

code-brighton’s picture

Hi Goodeit, Many thanks again for your reply and yes the solution was the Feeds Tamper module. I already had it installed and that's what the old importer was using. I just needed to add an "List -> Explode" on the catalog field.

himanshupathak3’s picture

Thank You very much !!! It really helped me :-)

b n pandey’s picture

Thank you so much for your post...

Anandyrh’s picture

Thanks a lot for your effort,

I have updated my doubts here: https://drupal.org/node/1802908#comment-6863754

ballooning4u’s picture

Thank You very much !

applaps’s picture

Hey guys - I installed your file and am trying to import. After importing I get a green tick and a message 'There are no new nodes'... at the bottom is the file i am trying to test... I assumed that it would create the product type if it didnt exist, but also tried manually creating the product type...

Its also worth mentioning that when I manually create a product, i get the following warnings/errors:

Notice: Undefined property: stdClass::$attributes in uc_feeds_node_insert() (line 123 of /Applications/MAMP/htdocs/drupal-7-1.18/sites/all/modules/uc_feeds/uc_feeds.module).

Warning: Invalid argument supplied for foreach() in uc_feeds_node_insert() (line 123 of /Applications/MAMP/htdocs/drupal-7-1.18/sites/all/modules/uc_feeds/uc_feeds.module).

Any help is greatly appreciated! Thanks :)

Product Name,Description,Image,Product Type,SKU,List price,Cost,Sell price,Weight,Dimensions
Chrome Rim,Awesome mags,test,Wheels,chrome_rim,1,1,1,1,1

EDIT: Wasn't saving CSV file properly... choosing Windows .csv resolved my issue.

reinstallation of moduls seemed to get rid of notice/warning messages

hockey2112’s picture

@goodeit, Your tutorial worked very nicely! My only issue is that Options with spaces in the option name (for instance, "Light Blue") are not being added to the product during import. How can I set those column headers so that they will be imported?

For instance, my column header is currently in this format:

Color-Light Blue-Price

EDIT
==========================
After investigating the import/uc_feeds_product_importer page, I noticed that it listed those options without the spaces (in the "one or more of these columns" text). I changed my spreadsheet to reflect this change, and it now uploads all options beautifully!

timmyg13’s picture

How wer you able to import multiple images? What is the separator if it under the same column?

jpdaut’s picture

I was hoping to use your module. However I'm getting the error I reported on http://drupal.org/node/2057165.

Can you shed any light on what could be happening, I'm getting errors like the below when trying to import attributes:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '857-1' for key 1

Thanks.

johnish’s picture

I followed the instructions. When I do the import it says Please select a bundle. and cannot create content type. So I edited the ubercart product feed importer and selected the bundle 'products' and reran, I got the same errors.

When I go to /admin/structure/feeds/uc_feeds_product_importer/mapping I see that the target for everything says "Missing".

strings6’s picture

Hi all,

What would be the best approach if we wanted the importer to create attributes and options (and assign them to products) on the fly if they didn't already exist, and update them at the product level if they do exist?

Everything I've read so far seems to assume that all the product attributes will already be in ubercart and assigned to products, and then the feeds import just sets some price and weight values.

For my use case, I have lots of products with unique attributes and options specific to that product, and I'm trying to write something to import all that into a D7 Ubercart site, without hand entering anything (including product attributes and their options).

If anyone has any ideas, let me know.
Thanks!

acdtrp’s picture

Has anyone ever managed to update the node's attributes or options successfully? Creating them works like charm, but updating doesn't care about attributes or options no matter if Replace or Update is selected or skip hash check.

strings6’s picture

@acdtrp: When you say, "Creating them works like a charm", do you mean you pre-entered the attributes and options, and then the feeds importer assigned them to products and set the prices/weights?

I'm still trying to find a way to create attributes and options on the fly.

problue solutions’s picture

I have followed the instructions in #4 but cant get this to work at all. I'm not sure exactly what the module supports as strings6 says in #21, but I have tried the following:

1. Created attributes and options but didn't assign any to products, uploaded feed as per instructions.

RESULT: attribute is not added to product.

2. Created attributes and options and assigned attribute to test product, didn't set any prices, uploaded feed with prices for options.

RESULT: prices are not added to options.

3. Didn't create any attributes or options in Ubercart at all, uploaded feed with prices for options and attributes.

RESULT: attributes and options are not created.

So basically nothing is working for me at all, regardless of which of the above is supposed to work.

I'm not getting an errors and the rest of the feed data is importing fine.

I'm sure I'm doing everything right as per the instructions above. Is there anything else I can check?

problue solutions’s picture

I think I've figured out why it wasn't working.

If you import a node which already exists (even if you choose 'replace' and not 'update' in the feed settings) the attribute import doesn't work. You can only use it to import brand new products where the unique identifier (usually SKU) doesn't already exist, regardless of any feed settings for replacing nodes.