ShippingMethodEntity
$shippingMethod,
LineItemCollection
$collection,
SalesChannelContext
$context ): ?Delivery
{ $positions =
new DeliveryPositionCollection();
$deliveryTime = null;
// use shipping method delivery time as default
if ($shippingMethod->
getDeliveryTime() !== null
) { $deliveryTime = DeliveryTime::
createFromEntity($shippingMethod->
getDeliveryTime());
} $this->
buildPositions($collection,
$positions,
$deliveryTime);
if ($positions->
count() <= 0
) { return null;
} return new Delivery( $positions,
$this->
getDeliveryDateByPositions($positions),
$shippingMethod,
$context->
getShippingLocation(),
new CalculatedPrice(0, 0,
new CalculatedTaxCollection(),
new TaxRuleCollection()) );