Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getDeliveryDateByPositions example
$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
(
)
)
)
;
}
private
function
getDeliveryDateByPositions
(
DeliveryPositionCollection
$positions
)
: DeliveryDate
{
// this function is only called if the provided collection contains a deliverable line item
$max
=
$positions
->
first
(
)
->
getDeliveryDate
(
)
;