From 938ffbe66b2392cce1cf11d9c44e17964d56673d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Thu, 22 Feb 2024 14:07:34 +0100 Subject: [PATCH] Form only view for required client info --- app/Livewire/RequiredClientInfo.php | 11 ++++++++++ .../livewire/required-client-info.blade.php | 22 ++++++++++--------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/app/Livewire/RequiredClientInfo.php b/app/Livewire/RequiredClientInfo.php index a4595b771ef2..80e2654fdcd7 100644 --- a/app/Livewire/RequiredClientInfo.php +++ b/app/Livewire/RequiredClientInfo.php @@ -143,6 +143,8 @@ class RequiredClientInfo extends Component public $company_gateway_id; + public bool $form_only = false; + public function mount() { MultiDB::setDb($this->company->db); @@ -162,6 +164,15 @@ class RequiredClientInfo extends Component count($this->fields) > 0 || $this->show_terms ? $this->checkFields() : $this->show_form = false; + + if (request()->query('source') === 'subscriptions') { + $this->show_form = false; + + $this->dispatch( + 'passed-required-fields-check', + client_postal_code: $this->contact->client->postal_code + ); + } } public function toggleTermsAccepted() diff --git a/resources/views/portal/ninja2020/components/livewire/required-client-info.blade.php b/resources/views/portal/ninja2020/components/livewire/required-client-info.blade.php index ba6e6ac7175c..6dde0bba9fa7 100644 --- a/resources/views/portal/ninja2020/components/livewire/required-client-info.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/required-client-info.blade.php @@ -1,14 +1,16 @@ -
-
-
-

- {{ ctrans('texts.required_payment_information') }} -

+
+
+ @unless($form_only) +
+

+ {{ ctrans('texts.required_payment_information') }} +

-

- {{ ctrans('texts.required_payment_information_more') }} -

-
+

+ {{ ctrans('texts.required_payment_information_more') }} +

+
+ @endunless
@foreach($fields as $field)