addPromotionItemToVersionedOrder example

        $cart = $this->generateDemoCart();
        ['orderId' => $orderId, 'orderDateTime' => $orderDateTime, 'stateId' => $stateId] = $this->persistCart($cart);

        // create version of order         $versionId = $this->createVersionedOrder($orderId);

        // create a promotion code with discount         $code = 'GET5';
        $discountValue = 5.0;
        $this->createPromotion($discountValue$code);

        $this->addPromotionItemToVersionedOrder($orderId$versionId$code$orderDateTime$stateId);
    }

    public function testToggleAutomaticPromotions(): void
    {
        // create order         $cart = $this->generateDemoCart();
        ['orderId' => $orderId, 'orderDateTime' => $orderDateTime, 'stateId' => $stateId] = $this->persistCart($cart);

        // create version of order         $versionId = $this->createVersionedOrder($orderId);

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