Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
missingOrderNumber example
$cart
=
new
Cart
(
Uuid::
randomHex
(
)
)
;
$cart
->
setPrice
(
$order
->
getPrice
(
)
)
;
$cart
->
setCustomerComment
(
$order
->
getCustomerComment
(
)
)
;
$cart
->
setAffiliateCode
(
$order
->
getAffiliateCode
(
)
)
;
$cart
->
setCampaignCode
(
$order
->
getCampaignCode
(
)
)
;
$cart
->
setSource
(
$order
->
getSource
(
)
)
;
$cart
->
addExtension
(
self::ORIGINAL_ID,
new
IdStruct
(
$order
->
getId
(
)
)
)
;
$orderNumber
=
$order
->
getOrderNumber
(
)
;
if
(
$orderNumber
=== null
)
{
throw
OrderException::
missingOrderNumber
(
$order
->
getId
(
)
)
;
}
$cart
->
addExtension
(
self::ORIGINAL_ORDER_NUMBER,
new
IdStruct
(
$orderNumber
)
)
;
/* NEXT-708 support: - transactions */
$lineItems
= LineItemTransformer::
transformFlatToNested
(
$order
->
getLineItems
(
)
)
;
$cart
->
addLineItems
(
$lineItems
)
;
$cart
->
setDeliveries
(