Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
AfterLineItemRemovedEvent example
$cart
->
remove
(
$id
)
;
$this
->eventDispatcher->
dispatch
(
new
BeforeLineItemRemovedEvent
(
$lineItem
,
$cart
,
$context
)
)
;
$cart
->
markModified
(
)
;
}
$cart
=
$this
->cartCalculator->
calculate
(
$cart
,
$context
)
;
$this
->cartPersister->
save
(
$cart
,
$context
)
;
$this
->eventDispatcher->
dispatch
(
new
AfterLineItemRemovedEvent
(
$lineItems
,
$cart
,
$context
)
)
;
$this
->eventDispatcher->
dispatch
(
new
CartChangedEvent
(
$cart
,
$context
)
)
;
return
new
CartResponse
(
$cart
)
;
}
}