Now that we have fancy attributes to control how the product variation selection widget renders, we should bring it to a field formatter as well. This would be a field formatter which only attaches to an entity reference field that points to commerce_product_variation.

The field formatter's settings will allow a user to pick which attributes should be rendered. It will render the default display mode.

This will allow us to fully deprecate all the functionality Commerce Fancy Attributes provided us via Field Extractor:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Assigned: Unassigned » mglaman
mglaman’s picture

Issue summary: View changes
FileSize
8.03 KB

Here is the patch to add the new formatter.

PR: https://github.com/drupalcommerce/commerce/pull/378

mglaman’s picture

Forgot the field formatter schema.

field.formatter.settings.commerce_product_attributes_overview:
  type: mapping
  mapping:
    attributes:
      type: sequence
      label: 'Attributes to render.'
mglaman’s picture

Status: Active » Needs work

Work ongoing in the PR.

bojanz’s picture

Status: Needs work » Needs review

PR is almost ready, minor nitpicks left.

  • bojanz committed 99885d0 on 8.x-2.x authored by mglaman
    Issue #2719479 by mglaman: Add field formatter for variations field to...
bojanz’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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