Allow AddToCartFormatter to hide variant field if only one variant

Created on 23 February 2024, 10 months ago

When a product page is displayed with the add-to-cart formatter to show the variations, if there is only one variant it is redundant to show that field.

It might be useful to have an option on AddToCartFormatter to hide the variant field if there is only one variant.

Feature request
Status

Active

Version

2.0

Component

Product

Created by

🇺🇸United States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @DamienMcKenna
  • Status changed to Postponed: needs info 8 months ago
  • 🇮🇱Israel jsacksick

    Are you not using the "commerce_product_variation_title" widget? There is the following setting:

        $element['hide_single'] = [
          '#type' => 'checkbox',
          '#title' => $this->t("Hide if there's only one product variation"),
          '#default_value' => $this->getSetting('hide_single'),
        ];

    Perhaps you could elaborate with screenshots as I'm not 100% sure about the issue reported here...

  • 🇺🇸United States DamienMcKenna NH, USA

    This is the product type view mode settings:

  • 🇺🇸United States DamienMcKenna NH, USA

    Ah! I had to edit the Order Item Type form display settings, that was the step I was missing.

Production build 0.71.5 2024