| Total Complexity | 5 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 21 | #[Package('storefront')] |
||
| 22 | class CheckoutCartPageLoadedHook extends PageLoadedHook implements CartAware |
||
| 23 | { |
||
| 24 | use SalesChannelContextAwareTrait; |
||
| 25 | |||
| 26 | final public const HOOK_NAME = 'checkout-cart-page-loaded'; |
||
| 27 | |||
| 28 | public function __construct( |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getName(): string |
||
| 37 | { |
||
| 38 | if ($this->getCart()->getSource()) { |
||
| 39 | return self::HOOK_NAME . '-' . $this->getCart()->getSource(); |
||
| 40 | } |
||
| 41 | |||
| 42 | return self::HOOK_NAME; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function getPage(): CheckoutCartPage |
||
| 48 | } |
||
| 49 | |||
| 50 | public function getCart(): Cart |
||
| 55 |