Sylius\Behat\Context\Setup\PromotionContext::itGivesOffOnEveryProductClassifiedAsOrIfOrderContainsAnyProductClassifiedAsOr PHP Method

itGivesOffOnEveryProductClassifiedAsOrIfOrderContainsAnyProductClassifiedAsOr() public method

public itGivesOffOnEveryProductClassifiedAsOrIfOrderContainsAnyProductClassifiedAsOr ( Sylius\Component\Core\Model\PromotionInterface $promotion, $discount, array $discountTaxons, array $targetTaxons )
$promotion Sylius\Component\Core\Model\PromotionInterface
$discountTaxons array
$targetTaxons array
    public function itGivesOffOnEveryProductClassifiedAsOrIfOrderContainsAnyProductClassifiedAsOr(PromotionInterface $promotion, $discount, array $discountTaxons, array $targetTaxons)
    {
        $discountTaxonsCodes = [$discountTaxons[0]->getCode(), $discountTaxons[1]->getCode()];
        $targetTaxonsCodes = [$targetTaxons[0]->getCode(), $targetTaxons[1]->getCode()];
        $rule = $this->ruleFactory->createHasTaxon($targetTaxonsCodes);
        $this->createUnitPercentagePromotion($promotion, $discount, $this->getTaxonFilterConfiguration($discountTaxonsCodes), $rule);
    }
PromotionContext