getApplierKey example

$payload['filter'] = [
            'sorterKey' => null,
            'applierKey' => null,
            'usageKey' => null,
            'pickerKey' => null,
        ];

        if ($discount->isConsiderAdvancedRules()) {
            $payload['filter'] = [
                'sorterKey' => $discount->getSorterKey(),
                'applierKey' => $discount->getApplierKey(),
                'usageKey' => $discount->getUsageKey(),
                'pickerKey' => $discount->getPickerKey(),
            ];
        }

        return $payload;
    }

    /** * Gets the absolute price for the provided currency. * This can either be a specific value or the default discount value. */
static::assertInstanceOf(PromotionDiscountCollection::class$discounts = $promotion->getDiscounts());
        static::assertCount(2, $discounts);

        $firstDiscount = $discounts->first();
        static::assertInstanceOf(PromotionDiscountEntity::class$firstDiscount);
        static::assertEquals('cart', $firstDiscount->getScope());
        static::assertEquals('absolute', $firstDiscount->getType());
        static::assertEquals(5, $firstDiscount->getValue());
        static::assertFalse($firstDiscount->isConsiderAdvancedRules());
        static::assertNull($firstDiscount->getMaxValue());
        static::assertEquals('PRICE_ASC', $firstDiscount->getSorterKey());
        static::assertEquals('ALL', $firstDiscount->getApplierKey());
        static::assertEquals('ALL', $firstDiscount->getUsageKey());
        static::assertEmpty($firstDiscount->getPickerKey());
        static::assertInstanceOf(RuleCollection::class$firstDiscountRules = $firstDiscount->getDiscountRules());
        static::assertEmpty($firstDiscountRules->getIds());

        $lastDiscount = $discounts->last();
        static::assertInstanceOf(PromotionDiscountEntity::class$lastDiscount);
        static::assertEquals('set', $lastDiscount->getScope());
        static::assertEquals('percentage', $lastDiscount->getType());
        static::assertEquals(2.5, $lastDiscount->getValue());
        static::assertTrue($lastDiscount->isConsiderAdvancedRules());
        
Home | Imprint | This part of the site doesn't use cookies.