Followup to #2716417: Allow rendering of variation fields on the product entity..

We currently inject all fields, including the attributes. But attributes are already represented via the add to cart form, which is enough for the default use case.
So let's hide the rendered attribute fields.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz created an issue. See original summary.

mglaman’s picture

Status: Active » Needs review
FileSize
3.64 KB

Patch! PR to follow

mglaman’s picture

  • bojanz committed 906f91f on 8.x-2.x authored by mglaman
    Issue #2723693 by mglaman: Hide the rendered attribute fields in the...
bojanz’s picture

Status: Needs review » Fixed

Thanks!

agoradesign’s picture

Status: Fixed » Needs review
FileSize
973 bytes

Sorry Matt, I've to re-open this one, as it does not work as expected at all. There are two problems here:

  1. You mixed up your strpos() call, so the attributes won't never be added to the array
  2. If it would work, the attributes would be added twice to build, you need an else branch

Seems that the tests did not cover the check for existence of the grouped attributes array. And as they weren't added at all, no test failed. I haven't run the tests yet, nor I did add some. Attached is just a fix for the code

  • bojanz committed 9581589 on 8.x-2.x authored by agoradesign
    Issue #2723693 by mglaman, agoradesign: Hide the rendered attribute...
bojanz’s picture

Status: Needs review » Fixed

DrupalCon is not a good time for committing stuff :) Thanks!

Status: Fixed » Closed (fixed)

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