Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CheckoutFinishPageOrderCriteriaEvent example
->
addAssociation
(
'deliveries.shippingMethod'
)
->
addAssociation
(
'billingAddress.salutation'
)
->
addAssociation
(
'billingAddress.country'
)
->
addAssociation
(
'billingAddress.countryState'
)
->
addAssociation
(
'deliveries.shippingOrderAddress.salutation'
)
->
addAssociation
(
'deliveries.shippingOrderAddress.country'
)
->
addAssociation
(
'deliveries.shippingOrderAddress.countryState'
)
;
$criteria
->
getAssociation
(
'transactions'
)
->
addSorting
(
new
FieldSorting
(
'createdAt'
)
)
;
$this
->eventDispatcher->
dispatch
(
new
CheckoutFinishPageOrderCriteriaEvent
(
$criteria
,
$salesChannelContext
)
)
;
try
{
$searchResult
=
$this
->orderRoute
->
load
(
new
Request
(
)
,
$salesChannelContext
,
$criteria
)
->
getOrders
(
)
;
}
catch
(
InvalidUuidException
)
{
throw
OrderException::
orderNotFound
(
$orderId
)
;
}
/** @var OrderEntity|null $order */