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

thisPromotionGivesDiscountToEveryOrderInTheChannelAndDiscountToEveryOrderInTheChannel() public method

public thisPromotionGivesDiscountToEveryOrderInTheChannelAndDiscountToEveryOrderInTheChannel ( Sylius\Component\Core\Model\PromotionInterface $promotion, $firstChannelDiscount, Sylius\Component\Core\Model\ChannelInterface $firstChannel, $secondChannelDiscount, Sylius\Component\Core\Model\ChannelInterface $secondChannel )
$promotion Sylius\Component\Core\Model\PromotionInterface
$firstChannel Sylius\Component\Core\Model\ChannelInterface
$secondChannel Sylius\Component\Core\Model\ChannelInterface
    public function thisPromotionGivesDiscountToEveryOrderInTheChannelAndDiscountToEveryOrderInTheChannel(PromotionInterface $promotion, $firstChannelDiscount, ChannelInterface $firstChannel, $secondChannelDiscount, ChannelInterface $secondChannel)
    {
        /** @var PromotionActionInterface $action */
        $action = $this->actionFactory->createFixedDiscount($firstChannelDiscount, $firstChannel->getCode());
        $action->setConfiguration(array_merge($action->getConfiguration(), [$secondChannel->getCode() => ['amount' => $secondChannelDiscount]]));
        $promotion->addChannel($firstChannel);
        $promotion->addChannel($secondChannel);
        $promotion->addAction($action);
        $this->objectManager->flush();
    }
PromotionContext