We’re sorry but this documentation section is outdated. Please have that in mind when trying to use it. You can help us making documentation up to date via Sylius Github. Thank you!


You can use it when your subject implements the CountablePromotionSubjectInterface:


$itemCountChecker = new ItemCountRuleChecker();
// a Subject that implements the CountablePromotionSubjectInterface

$configuration = array('count' => 2);

$itemCountChecker->isEligible($subject, $configuration); // returns true


If your subject implements the PromotionSubjectInterface you can use it with this checker.


$itemTotalChecker = new ItemTotalRuleChecker();

// a Subject that implements the PromotionSubjectInterface
// Let's assume the subject->getSubjectItemTotal() returns 199

$configuration = array('amount' => 199);

$itemTotalChecker->isEligible($subject, $configuration); // returns true