A lot of my products are using product types with drop down lists and suggested by the commerce guys module as the main method to set up products. The fields with these drop down menus, or list selectable options are not appearing as targets in the drop down list of your feeds interface. Any suggestions?

Comments

cesanford30’s picture

I guess I am just going in the backend and rolling them into the database directly? Sounds easier once you nail down the mappings and relations.

pcambra’s picture

Please watch this screencast by rfay to see the step-by-step for feeds and commerce: http://www.drupalcommerce.org/node/467

cesanford30’s picture

Yes very nice video, I watched it 2 times. However, if a field is configured as a text list and a list widget (required by drupal commerce to show attributes), those fields are not showing up in your target list so they cannot be mapped.

I did go into the database, and see that any additional product fields that are list type fields, have a new table created for them with a reference to the product ID in the main Product table.

So I am for now, simply using your feeds for the primary data, then on the backend rolling in the additional fields as a database direct csv import.

Hope it works.

If there is a setting to get list widgets to show up in your feed, please let me know because the video makes no reference to this type of field.

Charlie

cesanford30’s picture

No still not there, thought they were, but no cigar.

Charlie

rfay’s picture

Title: missing target fields » Importing products with attributes
StatusFileSize
new2.87 KB
new237 bytes
new2.05 KB

As far as I can tell, this request is about importing products with attributes like "color" or "size". The DrupalCommerce FAQ explains the basics of how to do this.

What we need here is a product with "size" and "color" fields, set them up according to the FAQ, and then import them using the techniques in the manual.

The only thing that hasn't been covered yet is importing those extra attributes, which is regular feeds stuff, not really about Commerce Feeds. You use the *code* or *machine name* of each item, so "l", "m", and "s" in the case we'll do here, not "Large", "Medium", and "Small".

I've attached a feature with the fields I set up and the product importer I used, and a CSV of the products, and even a CSV that can be used to import a single node that refers to all 6 of these products.

This seemed to work fine for me. To import the node you'll need feeds_tamper module as explained in #1122422-7: CSV Import multiple product reference to product display .

dbkern’s picture

I tried enabling your feature but it caused a fatal error--re: ~ field exception due to changing a field-type. Unfortunately, without seeing your feature in-action, I'm having a difficult time seeing how this method circumvents the problem of being unable to map the list(text) fields.

From your listfeeds_code file it appears you are mapping multiple variables in the size and color fields. This is possible to do if your field is a text field--not a list(text) field.

With at least the latest version (beta4) of Drupal Commerce you can specify which field is displayed for multiattribute selection in the product display----it no longer defaults to the product title. The values of this list(text) field is apparently stored in a different table and the commerce feeds processor doesn't seem to take this into account as there is no option for that field during mapping. The only recourse is to go in after importation, and enter values for the multiattribute field manually or import to the database directly.

rfay’s picture

Please try the feature and the commerce_feeds_example with a fresh install, so you can understand what's going on.

rfay’s picture

Please try the feature and the commerce_feeds_example with a fresh install, so you can understand what's going on.

dbkern’s picture

StatusFileSize
new59.83 KB
new88.14 KB

Ray,

I utilized your feature (#5) and .csvs in a fresh install to see if I can better understand the process. Unfortunately, your method also does not appear to work for me. The product display shows a choice of product titles but it does not give an option for sizes or colors and the available titles link to their respective product listings. See attached file.

Evidently, there is no way for the product listing to know that size or color are multiattribute fields--they are neither required fields nor are they checked to be so. Furthermore, the size and color fields in the product listings are not populated with any values. The mapping for importation did not include these fields.

So, I guess my questions are:
1) In order to have a select list in the product display for size and/or color of t-shirts, is it necessary to import those values into the product listings? If not, I don't understand how a node import can accomplish this instead.

2) If these values are necessary, and the fields are not available to select as targets in the product importer, is there any other recourse than manual entry or direct importation into the database?

rfay’s picture

@dbkern, just for the record, my username is rfay and my name is Randy.

I've created a screencast demonstrating the technique for you, http://vimeo.com/25668519

The manual page on how this all works is http://www.drupalcommerce.org/node/467

I hope that will figure out what it is you're saying that I'm not understanding.

dbkern’s picture

Randy,

My sincerest apologies for the name confusions. It was sleepless weekend.

I just watched the video you created and I must say it is excellent and will save many people many hours trying to piece this information together from various sources. Thank you for that.

I had already gotten myself acquainted with all of these steps--except for the exploding of the product reference field in the node import.

My main problem was not what I was attempting to do. I was following the steps you have in your video. But.. I was not able to map to a select list field--I couldn't target the multivalue field(s). I though it was perhaps something with Commerce Feeds. Instead, the problem was with the Feeds module. See http://drupal.org/node/1080312. The problem was that the type list_text was absent from the array of eligible string type fields in field.inc in version 7.x-2.0-alpha3. There is a patch at the link or utilizing the latest dev version takes care of the issue.

Thanks again for your help--the video will be a great resource for many people.

rfay’s picture

Glad it's working for you... #1080312: Feeds mapping does not recognize text fields using list widget hasn't yet been committed, so that's not the reason.

dbkern’s picture

Well, the patch may not be committed but the the type list_text was absent from the array of eligible string type fields in field.inc in version 7.x-2.0-alpha3 at line 28 and it is there in field.inc for version 7.x-2.x-dev at line 27. The only change the patch makes is to add it to the array. That is the only change I made on both of my sites and they both now will map list(text) fields. That's all I can offer. Again, thanks greatly for your help--especially for the wonderful video.

rfay’s picture

Status: Active » Fixed

Calling this good. Thanks for the feedback.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.