public function CouponInterface::available in Commerce Core 8.2
Checks whether the coupon is available for the given order.
Ensures that the parent promotion is available, the coupon is enabled, and the usage limits are respected.
Parameters
\Drupal\commerce_order\Entity\OrderInterface $order: The order.
Return value
bool TRUE if coupon is available, FALSE otherwise.
1 method overrides CouponInterface::available()
- Coupon::available in modules/
promotion/ src/ Entity/ Coupon.php - Checks whether the coupon is available for the given order.
File
- modules/
promotion/ src/ Entity/ CouponInterface.php, line 138
Class
- CouponInterface
- Provides an interface for defining coupon entities.
Namespace
Drupal\commerce_promotion\EntityCode
public function available(OrderInterface $order);