Problem/Motivation

The coupons table (promotion/12345/coupons) currently doesn't show the start / end date and if one is set.

Just like the parent promotions table I think the overview table for the coupons should show all relevant values at a glance. It's already quite complicated for users to understand that the master table doesn't show all the information and coupon codes can have a different start / end date.

Steps to reproduce

Proposed resolution

Add

  • Status
  • Start Date
  • End Date

to the coupons table

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork commerce-3585274

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

Issue summary: View changes
Issue tags: +Novice
sapnil_biswas’s picture

Assigned: Unassigned » sapnil_biswas

Starting to work on it

sapnil_biswas’s picture

Assigned: sapnil_biswas » Unassigned
Status: Active » Needs review

@anybody Marking this for review took a bit of AI help for the YAML part, please let me know if there is anything over the board or requires some change

tbkot made their first commit to this issue’s fork.

tbkot’s picture

Updated the MR:
- Replaced the insert with the more proper revert
- Updated a test to confirm dates are there

anybody’s picture

Status: Needs review » Needs work

Thanks @tbkot! I left some comments. LGTM already.

The failing tests seem unrelated?

brandonlira made their first commit to this issue’s fork.

brandonlira’s picture

Status: Needs work » Needs review

Hi,

I updated the MR to address both points:

  • - Removed the post update that reverted `views.view.commerce_promotion_coupons`, so existing installations won't have their customized coupons View touched.
  • - Checked the date format used in Commerce: the parent promotions View uses the `commerce_store_datetime` formatter with `date_format: medium` for start/end dates. The coupons View now uses the same formatter/settings, and the coupon list builder fallback was updated to use Drupal's `date.formatter` with `medium` instead of the hard-coded `M jS Y H:i:s`.

I also rebased the branch against the latest `3.x`.

Thank you!

anybody’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for resolving that @brandonlira! I think it's fine. I personally would like to have the columns sortable: true but maintainers should decide.

Very helpful to have this! Thanks!

jsacksick’s picture

ofc... No reason to not make the dates sortable.

anybody’s picture

Thanks @jsacksick - I did that for the columns that make sense in my eyes.

jsacksick’s picture

Status: Reviewed & tested by the community » 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.