addDeliveries example

$price,
                        static::createMock(DeliveryDate::class)
                    ),
                ]),
                static::createMock(DeliveryDate::class),
                static::createMock(ShippingMethodEntity::class),
                static::createMock(ShippingLocation::class),
                $price
            ),
        ]);

        $cart->addDeliveries($deliveries);

        return $cart;
    }
}
$childItem->setCover($cover);

        return $item;
    }

    /** * @param array<string, mixed> $payload */
    private static function payloadCart(string $id, array $payload): Cart
    {
        $cart = (new Cart('test'))->add(self::payloadItem($id$payload));
        $cart->addDeliveries(self::itemDelivery(self::payloadItem($id$payload)));

        return $cart;
    }

    private static function coverCart(string $id, ?string $thumbnailString, bool $skipCover = false): Cart
    {
        $cart = (new Cart('test'))->add(self::coverItem($id$thumbnailString$skipCover));
        $cart->addDeliveries(self::itemDelivery(self::coverItem($id$thumbnailString$skipCover)));

        return $cart;
    }

    
clone $calculatedPrice,
                        new DeliveryDate(new \DateTimeImmutable()new \DateTimeImmutable())
                    ),
                ]),
                new DeliveryDate(new \DateTimeImmutable()new \DateTimeImmutable()),
                new ShippingMethodEntity(),
                new ShippingLocation(new CountryEntity()new CountryStateEntity(), null),
                clone $calculatedPrice
            ),
        ]);

        $cart->addDeliveries($deliveries);

        $calculator = new AmountCalculator(
            new CashRounding(),
            new PercentageTaxRuleBuilder(),
            new TaxCalculator()
        );

        $context = $this->createMock(SalesChannelContext::class);
        $context
            ->method('getTotalRounding')
            ->willReturn(new CashRoundingConfig(2, 0.01, true));

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