Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
shouldIncludeCustomer example
throw
new
DeliveryWithoutAddressException
(
)
;
}
$data
= CartTransformer::
transform
(
$cart
,
$context
,
$this
->initialStateIdLoader->
get
(
OrderStates::STATE_MACHINE
)
,
$conversionContext
->
shouldIncludeOrderDate
(
)
)
;
if
(
$conversionContext
->
shouldIncludeCustomer
(
)
)
{
$customer
=
$context
->
getCustomer
(
)
;
if
(
$customer
=== null
)
{
throw
CartException::
customerNotLoggedIn
(
)
;
}
$data
[
'orderCustomer'
]
= CustomerTransformer::
transform
(
$customer
)
;
}
$data
[
'languageId'
]
=
$context
->
getLanguageId
(
)
;
$convertedLineItems
= LineItemTransformer::
transformCollection
(
$cart
->
getLineItems
(
)
)
;