I am trying to embed part of the order entity in a custom pane by following the documentation
https://docs.drupalcommerce.org/commerce2/developer-guide/checkout/creat...

   $form_display = EntityFormDisplay::collectRenderDisplay($this->order, 'my_form_display');
    $form_display->buildForm($this->order, $pane_form, $form_state);
    return $pane_form;

However as I have the commerce_promotions module enabled the coupons is being automatically displayed.

I would like to make this optional

Patch provided.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

au_dave created an issue. See original summary.

au_dave’s picture

Issue summary: View changes
Aerzas’s picture

When the form display is made configurable it makes kernel tests fail because the size settings is of the wrong type. Here is the updated patch with the side issue fixed.

skyredwang’s picture

Version: 8.x-2.17 » 8.x-2.x-dev
Status: Active » Reviewed & tested by the community

The fix looks good. The test is green on D9

  • jsacksick committed ed3d732 on 8.x-2.x authored by au_dave
    Issue #3131962 by Aerzas, au_dave, skyredwang: Make Coupons field form...

  • jsacksick committed 2fe1691 on 3.0.x authored by au_dave
    Issue #3131962 by Aerzas, au_dave, skyredwang: Make Coupons field form...
jsacksick’s picture

Status: Reviewed & tested by the community » Fixed

60 is the default value, so it doesn't even have to be specified, other than that, fix looks good, committed, thank you!

Status: Fixed » Closed (fixed)

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