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

Command icon 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

anybody created an issue. See original summary.

anybody’s picture

Title: Add an action link to disable a coupon in a promotion » Add an action link to disable/enable a coupon in a promotion
nakaza sora’s picture

Assigned: Unassigned » nakaza sora

nakaza sora’s picture

Assigned: nakaza sora » Unassigned
Status: Active » Needs review

I 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!

jsacksick’s picture

Version: 3.0.x-dev » 3.x-dev

Can 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.

jsacksick’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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