createDiscounts example


    private function createPromotion(array $salesChannels): array
    {
        return [
            'id' => Uuid::randomHex(),
            'name' => $this->faker->format('productName'),
            'active' => true,
            'useSetGroups' => false,
            'salesChannels' => $salesChannels,
            'code' => $this->faker->unique()->format('promotionCode'),
            'useCodes' => true,
            'discounts' => $this->createDiscounts(),
        ];
    }

    /** * @return list<array<string, mixed>> */
    private function createDiscounts(): array
    {
        $discounts = [];
        $count = $this->faker->randomDigit() / 3;

        
Home | Imprint | This part of the site doesn't use cookies.