Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getConvertedCart example
$this
->orderDefinition->
getEntityName
(
)
,
$context
->
getContext
(
)
,
$context
->
getSalesChannel
(
)
->
getId
(
)
)
;
}
$data
[
'ruleIds'
]
=
$context
->
getRuleIds
(
)
;
$event
=
new
CartConvertedEvent
(
$cart
,
$data
,
$context
,
$conversionContext
)
;
$this
->eventDispatcher->
dispatch
(
$event
)
;
return
$event
->
getConvertedCart
(
)
;
}
/** * @throws CartException */
public
function
convertToCart
(
OrderEntity
$order
, Context
$context
)
: Cart
{
if
(
$order
->
getLineItems
(
)
=== null
)
{
throw
OrderException::
missingAssociation
(
'lineItems'
)
;
}