Loading modules/product/src/Form/AddToCartForm.php +12 −0 Changes for modules/product/src/Form/AddToCartForm.php: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -97,11 +97,23 @@ class AddToCartForm extends FormBase { } $form['#settings'] = $settings; // If there are multiple variations, display ability to select a variation. if (count($variations) > 1) { $form['variation'] = [ '#type' => 'select', '#title' => $this->t('Select variation:'), '#options' => $variations, ]; } // Otherwise set the variation and only display "add to cart". else { $form['variation'] = [ '#type' => 'value', '#value' => key($variations), ]; } if (!empty($settings['show_quantity'])) { $form['quantity'] = [ '#type' => 'number', Loading modules/product/src/Plugin/Field/FieldFormatter/AddToCartFormatter.php +1 −1 File changed.Contains only whitespace changes. Show changes Loading
modules/product/src/Form/AddToCartForm.php +12 −0 Changes for modules/product/src/Form/AddToCartForm.php: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -97,11 +97,23 @@ class AddToCartForm extends FormBase { } $form['#settings'] = $settings; // If there are multiple variations, display ability to select a variation. if (count($variations) > 1) { $form['variation'] = [ '#type' => 'select', '#title' => $this->t('Select variation:'), '#options' => $variations, ]; } // Otherwise set the variation and only display "add to cart". else { $form['variation'] = [ '#type' => 'value', '#value' => key($variations), ]; } if (!empty($settings['show_quantity'])) { $form['quantity'] = [ '#type' => 'number', Loading
modules/product/src/Plugin/Field/FieldFormatter/AddToCartFormatter.php +1 −1 File changed.Contains only whitespace changes. Show changes