Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
AddressListingPageLoadedEvent example
$criteria
=
(
new
Criteria
(
)
)
->
addSorting
(
new
FieldSorting
(
'firstName', FieldSorting::ASCENDING
)
)
;
$page
->
setAddresses
(
$this
->listAddressRoute->
load
(
$criteria
,
$salesChannelContext
,
$customer
)
->
getAddressCollection
(
)
)
;
$page
->
setCart
(
$this
->cartService->
getCart
(
$salesChannelContext
->
getToken
(
)
,
$salesChannelContext
)
)
;
$page
->
setAddress
(
$page
->
getAddresses
(
)
->
get
(
$request
->
get
(
'addressId'
)
)
)
;
$this
->eventDispatcher->
dispatch
(
new
AddressListingPageLoadedEvent
(
$page
,
$salesChannelContext
,
$request
)
)
;
return
$page
;
}
/** * @throws InconsistentCriteriaIdsException */
private
function
getSalutations
(
SalesChannelContext
$context
)
: SalutationCollection
{
$salutations
=
$this
->salutationRoute->
load
(
new
Request
(
)
,
$context
,
new
Criteria
(
)
)
->
getSalutations
(
)
;