i want to get the current cart when the product page is loaded.
public function onProductPageLoadedEvent(ProductPageLoadedEvent $event) {
$cart = ... get cart here
}
i have implemented the CartService already, but i need a token.
i want to get the current cart when the product page is loaded.
public function onProductPageLoadedEvent(ProductPageLoadedEvent $event) {
$cart = ... get cart here
}
i have implemented the CartService already, but i need a token.
Copyright © 2021 Jogjafile Inc.
The token is part of the SalesChannelContext. You can get the customer's cart like this: