Profiler::
trace('cart::delivery::process',
function D
) use ($data,
$original,
$toCalculate,
$context,
$behavior): void
{ if ($behavior->
hasPermission(self::SKIP_DELIVERY_PRICE_RECALCULATION
)) { $deliveries =
$original->
getDeliveries();
$firstDelivery =
$deliveries->
first();
if ($firstDelivery === null
) { return;
} // Stored original edit shipping cost
$manualShippingCosts =
$toCalculate->
getExtension(self::MANUAL_SHIPPING_COSTS
) ??
$firstDelivery->
getShippingCosts();
$toCalculate->
addExtension(self::MANUAL_SHIPPING_COSTS,
$manualShippingCosts);
if ($manualShippingCosts instanceof CalculatedPrice
) { $firstDelivery->
setShippingCosts($manualShippingCosts);
} $this->deliveryCalculator->
calculate($data,
$toCalculate,
$deliveries,
$context);
$toCalculate->
setDeliveries($deliveries);
return;
}