Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setPaymentChangeable example
$orderRouteResponse
=
$this
->
getOrder
(
$request
,
$salesChannelContext
)
;
/** @var OrderEntity $order */
$order
=
$orderRouteResponse
->
getOrders
(
)
->
first
(
)
;
if
(
$this
->
isOrderPaid
(
$order
)
)
{
throw
OrderException::
orderAlreadyPaid
(
$order
->
getId
(
)
)
;
}
$page
->
setOrder
(
$order
)
;
$page
->
setPaymentChangeable
(
$this
->
isPaymentChangeable
(
$orderRouteResponse
,
$page
)
)
;
$page
->
setPaymentMethods
(
$this
->
getPaymentMethods
(
$salesChannelContext
,
$request
,
$order
)
)
;
$page
->
setDeepLinkCode
(
$request
->
get
(
'deepLinkCode'
)
)
;
$this
->eventDispatcher->
dispatch
(
new
AccountEditOrderPageLoadedEvent
(
$page
,
$salesChannelContext
,
$request
)
)
;
return
$page
;
}
private
function
getOrder
(
Request
$request
, SalesChannelContext
$context
)
: OrderRouteResponse
{