コード例 #1
0
ファイル: PromotionContext.php プロジェクト: loic425/Sylius
 /**
  * @Given /^([^"]+) gives ("[^"]+%") off on every product (classified as "[^"]+" or "[^"]+") if order contains any product (classified as "[^"]+" or "[^"]+")$/
  */
 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->createTaxon($targetTaxonsCodes);
     $this->createUnitPercentagePromotion($promotion, $discount, $this->getTaxonFilterConfiguration($discountTaxonsCodes), $rule);
 }