- 🇩🇪Germany Anybody Porta Westfalica
Thank you very much for this useful feature request! I think this is a good and valuable idea, but I guess it should be a setting in the pane settings, so the shop owner can decide if form or link should be used.
So from my perspective we should finish this by:
- Turning this into a MR
- Adding a setting to the CouponRedemption checkout pane to select form or link (radio)
- Adding another test for this settingI'll add it to our roadmap! :)
- 🇩🇪Germany Anybody Porta Westfalica
Another option - instead of implementing this as link with custom JS - would be to make the label of the wrapper element configurable and translatable. If the details element is configured to be collapsed, it could simply be used for what this issue is supposed to do? And the expand functionality is already present.
See the currently already existing setting:
$form['wrapper_element_open'] = [ '#type' => 'checkbox', '#title' => $this->t('Display element open by default.'), '#default_value' => $this->configuration['wrapper_element_open'] ?? TRUE, ];
What's just missing then is an option to use a text like "Did you receive a coupon code?" instead of the hard-coded label?
@jsacksick and the others, what do you think? (Before we get started...)
- 🇩🇪Germany Anybody Porta Westfalica
Update: Just saw that we also added the option to override the pane labels in general here: https://git.drupalcode.org/project/commerce/-/commit/a78255493f7592e88c1...
( ✨ Allow customizing the wrapper element and the display label for checkout panes Needs review )So if we agree this is a good enough way, we could close this won't fix or closed as duplicate for 3.x! I think it's now possible, what the author of this issue tried to achieve!