| Total Complexity | 5 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 21 | #[Package('storefront')] |
||
| 22 | class CheckoutConfirmPageLoadedHook extends PageLoadedHook implements CartAware |
||
| 23 | { |
||
| 24 | use SalesChannelContextAwareTrait; |
||
| 25 | |||
| 26 | final public const HOOK_NAME = 'checkout-confirm-page-loaded'; |
||
| 27 | |||
| 28 | public function __construct( |
||
| 29 | private readonly CheckoutConfirmPage $page, |
||
| 30 | SalesChannelContext $context |
||
| 31 | ) { |
||
| 32 | parent::__construct($context->getContext()); |
||
| 33 | $this->salesChannelContext = $context; |
||
| 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(): CheckoutConfirmPage |
||
| 48 | } |
||
| 49 | |||
| 50 | public function getCart(): Cart |
||
| 55 |