Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It's becoming very annoying to load a coupon when we only know the code.
$coupon = $couponStorage->loadByProperties(['code' => $coupon_code]);
$coupon = reset($coupon);
Would be must easier if the storage could do this for us.
Comment | File | Size | Author |
---|---|---|---|
#2 | add_custom_coupon-2855815-2.patch | 1.92 KB | mitrpaka |
Comments
Comment #2
mitrpaka CreditAttribution: mitrpaka as a volunteer commentedPR: https://github.com/drupalcommerce/commerce/pull/653
Comment #3
mglamanAs stated on PR, let's just make it $code
Also, lets whip up a quick Kernel test to verify it works.
Comment #4
mglamanAddressed said items in PR https://github.com/drupalcommerce/commerce/pull/653
Comment #6
mglamanCommitted, thanks!