Problem/Motivation
Coupons in promotions can be disabled using a radio button. A better ux would be to allow disabling it directly from the list of coupons using a local action.
We recently had the case where a client DELETED a coupon because he didn't expect the disable functionality in the edit form, because he was used to finding the disable functionality in the list actions. I think from a UX perspective, that would indeed make sense.
Steps to reproduce
Edit a promotion and switch to the coupons list tab (/promotion/1234/coupons)
Proposed resolution
Implement the "disable" / "enable" functionality as local acton like in other lists
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork commerce-3559274
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anybodyComment #3
nakaza sora commentedComment #5
nakaza sora commentedI have created a merge request for the following fixes related to "Edit Add an action link to disable/enable a coupon in a promotion":
Changes:
1. Two new confirmation forms (CouponEnableForm.php and CouponDisableForm.php) that allow users to enable or disable a coupon with a confirmation step
2. Action links in the coupon list (CouponListBuilder.php) - "Enable" appears for disabled coupons, "Disable" appears for enabled coupons
3. Route definitions (CouponRouteProvider.php) for the new enable/disable form URLs
4. Entity configuration updates (Coupon.php) to register the new form handlers and link templates
Could you please review the merge request when you have time?
Thank you!
Comment #6
jsacksick commentedCan this be opened against 3.x which is the right branch to target please?
I see this is largely inspired from the promotion disable/enable functionality so the code looks ok at first glance.
I think an action would make sense too, as I imagine coupons being disabled in bulk rather than individually, but this is a fine addition too.
Comment #8
jsacksick commented