The PromotionUsage API is incomplete, there is no method for deleting usage for a set of coupons, nor one for loading usage for a set of coupons that belong to the same promotion (without adding them up to one number).
The following API changes will be made:
addUsage($order, $promotion, $coupon = NULL) -> register($order, $promotion, $coupon = NULL)
deleteUsage($promotions) -> delete($promotions)
getUsage($promotion, $coupon = NULL, $email = NULL) -> load($promotion, $mail = NULL)
getUsageMultiple($promotions, $coupons = [], $mail = NULL) -> loadMultiple($promotions, $mail = NULL)
New methods:
deleteByCoupon($coupons)
loadByCoupon($coupon, $mail = NULL)
loadMultipleByCoupon($coupons, $mail = NULL)
Comments
Comment #2
bojanz commentedComment #3
bojanz commentedBuild passed for https://github.com/drupalcommerce/commerce/commit/88067a36306662d3502c9a..., waiting for mglaman's +1.
Comment #4
mglaman+1 on my end.
Comment #6
bojanz commentedAdded the change request, merged.