Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Promotions
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Feb 2017 at 20:58 UTC
Updated:
24 Mar 2017 at 15:14 UTC
Jump to comment: Most recent
You can add new coupons and reuse existing codes. This causes errors when loading a coupon by its code, as its unknown (or incorrect) which promotion that is loaded.
Comments
Comment #2
vasikelet's try it
Comment #3
vasikeand there is a PR for this
https://github.com/drupalcommerce/commerce/pull/659
p.s. i also added a Validation test for Coupons there.
Comment #4
bojanz commentedWe can follow core's example and just extend the existing constraint, which means that we can customize the message without needing to write our own validator class.
Comment #5
bojanz commentedDone.
Also replaced the "A coupon with code %value already exists. Enter a unique code." message with "The coupon code %code is already in use and must be unique." to make it match the SKU message. We can change both at the same time if we don't like the phrasing.
Waiting on travis before push: https://travis-ci.org/drupalcommerce/commerce/jobs/209730881
Comment #7
bojanz commentedComment #8
mglamanYay!