Vote up!
Vote down!

Product entities for products with 30 + fields?

Electronic components have 30+ fields, 10 or so fields have different values from part to part. So the number of product variations are about 10 where each variation might have field values different from its sister part in one or two of the 10 fields.
fields: A B C D E F G H I J K L M N
part 1 d r u p a l c o m m e r c e
part 2 d r v p c l c o m m e r c e
part 3 g r u p a l v o n m e r c e
part 4 d r u p a l b j m m e r c e

To make it simple for the store owner, I use the product entity for all 30+ fields (as they are all characteristics of the part, not marketing fields) and he can use the feeds from excel sheet csv to input the product. That way he can copy and paste most of the fields conveniently and he is familiar with excel.

The question is: Can I use drupal commerce with product entities alone so he doesnt have to upload a second csv file for product display nodes?

It seems product display nodes are necessary for admin tasks ( products don't appear unless they have product displays) and I can't seem to make product search api ranges work with entities. Is there a help page on a case of using entities with no product display nodes?

Asked by: benlawraus
on February 27, 2013

1 Answer

Vote up!
Vote down!

I'd recommend you create a rule that creates a product display on the product creation event. This would be a very simple rule that would react on "Entity is created" and would need to "Create Node" and reference the appropriate product. Of course this only works for a 1:1 relationship. If you want a many:1 relationship, you'd need to have some sort of data that can be grouped.

For example, you might create a "display connector" column in your csv that has node ids or perhaps a simple, one word phrase. Then in your rule you could "Load an entity" based on that value and it's relation to values in a custom field. If it exists, add the product to the reference field. If it doesn't, create a node with that phrase in a custom field.

Josh Miller
Answer by: Josh Miller
Posted: Feb 27, 2013