UX research shows that coupon input fields reduce conversion cause they send the customer away googling for a coupon code.
Thus, a best practice is to have a "Did you receive a coupon code?" link that when clicked shows the form.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | coupon_code_form_default_hidden-2884210-8.patch | 8.37 KB | vasike |
Comments
Comment #2
jsacksick commentedShould we add that to the element type CouponRedemptionForm element or do we want that to leave inside the checkout pane?
Comment #3
mglamanWhen I first built the element, we have it on the element. Because I do not have pane based checkouts in most of my projects.
Comment #4
steveoliver commentedRelated: I noticed that the coupon redemption form refreshes the order totals part of the form, but not the rest of the form, like the payment gateway form.
Comment #5
steveoliver commentedWhich is to say, whether the implementation is a hidden form or a modal, the final action should refresh the whole checkout form.
Comment #6
vasikeHere is patch for this.
Approach: Add a "Did you receive a coupon code?" link with JS at the CouponRedemptionForm element template.
I think it's best to have it in template than in the form.
So anyone could customize as needed.
Also updated the Tests.
Comment #8
vasikeHmm. indeed i forgot to update also the CouponRedemptionElementTest
Here is a new patch
Comment #9
vasikeThe patch should also fix the broken test for CouponRedemptionPaneTest
https://www.drupal.org/pift-ci-job/863305
from patch:
Comment #10
anybodyThank 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 setting
I'll add it to our roadmap! :)
Comment #11
anybodyAnother 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:
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...)
That wonderful option was recently added here: #3470982: Allow customizing the wrapper element and the display label for checkout panes
Comment #12
anybodyComment #13
anybodyUpdate: Just saw that we also added the option to override the pane labels in general here: https://git.drupalcode.org/project/commerce/-/commit/a78255493f7592e88c1...
(#3470982: Allow customizing the wrapper element and the display label for checkout panes)
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!
Comment #14
anybody@jsacksick: I'd vote to close this outdated. The new settings in 3.x (see #13) can be used for this out of the box.