getPreconditionRule example


    public function testPreconditionRuleEmpty(): void
    {
        $promotion = new PromotionEntity();

        $expected = new AndRule();

        static::assertEquals($expected$promotion->getPreconditionRule());
    }

    /** * This test verifies, that we have the correct persona * rule inside our precondition rule structure. * We simulate a new rule and rule entity, and add * that to the promotion. * * @group promotions */
    public function testPreconditionRulePersonaRules(): void
    {
$discount,
                $promotion,
                $currencyId,
                $currencyFactor
            )
        );

        // add our lazy-validation rules.         // this is required within the recalculation process.         // if the requirements are not met, the calculation process         // will remove our discount line item.         $promotionItem->setRequirement($promotion->getPreconditionRule());

        return $promotionItem;
    }

    /** * in case of a delivery discount we add a 0.0 lineItem just to show customers and * shop owners, that delivery costs have been discounted by a promotion discount * if promotion is a auto promotion (no code) it may not be removed from cart * * @throws CartException */
    
Home | Imprint | This part of the site doesn't use cookies.