Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
shouldIncludeBillingAddress example
if
(
$conversionContext
->
shouldIncludeDeliveries
(
)
)
{
$shippingAddresses
= AddressTransformer::
transformCollection
(
$cart
->
getDeliveries
(
)
->
getAddresses
(
)
, true
)
;
$data
[
'deliveries'
]
= DeliveryTransformer::
transformCollection
(
$cart
->
getDeliveries
(
)
,
$convertedLineItems
,
$this
->initialStateIdLoader->
get
(
OrderDeliveryStates::STATE_MACHINE
)
,
$context
->
getContext
(
)
,
$shippingAddresses
)
;
}
if
(
$conversionContext
->
shouldIncludeBillingAddress
(
)
)
{
$customer
=
$context
->
getCustomer
(
)
;
if
(
$customer
=== null
)
{
throw
CartException::
customerNotLoggedIn
(
)
;
}
$activeBillingAddress
=
$customer
->
getActiveBillingAddress
(
)
;
if
(
$activeBillingAddress
=== null
)
{
throw
CartException::
addressNotFound
(
''
)
;
}
$customerAddressId
=
$activeBillingAddress
->
getId
(
)
;