Terminology:
Attribute - The grouping. "Color"
Attribute value - An individual item. "Red", "Blue".

Right now we use taxonomy terms for attributes, though the cart/product API actually supports any entity type.
We intentionally choose to support taxonomy_terms over list fields in 2.x because terms are fieldable, allowing color switches, images, price fields, etc.
However, mixing vocabularies and attributes has the same downside as mixing products and nodes in 1.x. One screen having data that doesn't serve the same purpose.

We also have a many-years-old problem of attribute discoverability. People don't know that they need to create a vocabulary with terms, then a reference field.
If there was a "Product attributes" link below Products, that would be a different story.
We could then at one point have a list of attributes on the product variation type edit screen, where selecting one would create the reference field in the background.

The plan:
- Create a commerce_product_attribute config entity type (same purpose as taxonomy_vocabulary before).
- Create a commerce_product_attribute_value content entity type (same purpose as taxonomy_term before).
- Create a UI where the attribute listing has a "List values" menu item which provides a single form for all values (field collection UI with a row per value embedding the entity form, and an Add more button)
- Ensure translations still work.

CommentFileSizeAuthor
#7 Screen Shot 2016-03-17 at 5.03.52 PM.png164.59 KBbojanz

Comments

bojanz created an issue. See original summary.

agoradesign’s picture

The new content entity type will hopefully be fieldable too, won't it?

bojanz’s picture

Of course, that's the whole point of using a content entity type.

skek’s picture

Hi @bojanz,

I want to start the work on this. Did you already started on some implementations?
If not, can you please provide some guidelines you want me to follow on this if have such?

bojanz’s picture

Hi skek,

I've already done the initial work, I'll get that merged today and then create followups that you can take on.

  • bojanz committed 68486b6 on 8.x-2.x
    Issue #2685873: Create our own entity types for product attributes
    
bojanz’s picture

Status: Active » Fixed
StatusFileSize
new164.59 KB

Committed the first version. Screenshot attached.

Opened #2689267: [meta] Complete the product attributes UI to track followups.
@skek See you there

Status: Fixed » Closed (fixed)

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