public function PromotionUsageInterface::loadByCoupon in Commerce Core 8.2
Loads the usage for the given coupon.
The optional $mail parameter can be used to restrict the usage count to a specific customer email.
Parameters
\Drupal\commerce_promotion\Entity\CouponInterface $coupon: The coupon.
string $mail: (Optional) The customer email.
Return value
int The usage.
1 method overrides PromotionUsageInterface::loadByCoupon()
- PromotionUsage::loadByCoupon in modules/
promotion/ src/ PromotionUsage.php - Loads the usage for the given coupon.
File
- modules/
promotion/ src/ PromotionUsageInterface.php, line 85
Class
- PromotionUsageInterface
- Tracks promotion usage.
Namespace
Drupal\commerce_promotionCode
public function loadByCoupon(CouponInterface $coupon, $mail = NULL);