public function PromotionInterface::available in Commerce Core 8.2
Checks whether the promotion is available for the given order.
Ensures that the order type and store match the promotion's, that the promotion is enabled, the current date matches the start and end dates, and the usage limits are respected.
Parameters
\Drupal\commerce_order\Entity\OrderInterface $order: The order.
Return value
bool TRUE if promotion is available, FALSE otherwise.
1 method overrides PromotionInterface::available()
- Promotion::available in modules/
promotion/ src/ Entity/ Promotion.php - Checks whether the promotion is available for the given order.
File
- modules/
promotion/ src/ Entity/ PromotionInterface.php, line 402
Class
- PromotionInterface
- Defines the interface for promotions.
Namespace
Drupal\commerce_promotion\EntityCode
public function available(OrderInterface $order);