storeManager->getWebsite()->getCode() !== 'eu_site') { return ['show' => false]; } $loggedIn = $this->customerSession->isLoggedIn(); $status = $this->applications->getCustomerStatus((int)$this->customerSession->getCustomerId()); $show = !$loggedIn || in_array($status, ['none', VatApplication::STATUS_REJECTED], true); $vatUrl = $this->urlBuilder->getUrl('esun_customer_vat/vat/new'); $applyUrl = $loggedIn ? $vatUrl : $this->urlBuilder->getUrl('customer/account/login', [ 'referer' => $this->urlEncoder->encode($vatUrl), ]); return [ 'show' => $show, 'is_logged_in' => $loggedIn, 'status' => $status, 'apply_url' => $applyUrl, ]; } }