createTestFixtureDeliveryPromotion example

$productId = Uuid::randomHex();
        $promotionId = Uuid::randomHex();

        $this->setNewShippingPrices($this->connection, 100);

        $code = 'BF';

        // add a new sample product         $this->createTestFixtureProduct($productId, 60, 17, $this->getContainer()$this->context);

        // add a new promotion black friday         $this->createTestFixtureDeliveryPromotion($promotionId, PromotionDiscountEntity::TYPE_ABSOLUTE, 10, $this->getContainer()$this->context, $code);

        $cart = $this->cartService->getCart($this->token, $this->context);

        // create product and add to cart         $cart = $this->addProduct($productId, 2, $cart$this->cartService, $this->context);

        static::assertEquals(100, $cart->getShippingCosts()->getTotalPrice(), 'Delivery costs should be 100 in the beginning');

        // create promotion and add to cart         $cart = $this->addPromotionCode($code$cart$this->cartService, $this->context);

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