Skip to content

Commit

Permalink
Added the VAT field on addresses and registration (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-GG authored Aug 22, 2023
1 parent e822a7a commit d8277ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions resources/views/account/partials/address-form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
@if(Rapidez::config('customer/address/company_show', 'opt'))
<x-rapidez::input name="company" v-model="variables.company" :required="Rapidez::config('customer/address/company_show', 'opt') == 'req'" />
@endif
@if(Rapidez::config('customer/address/taxvat_show', 0))
<x-rapidez::input name="vat_id" label="Tax/VAT ID" placeholder="Tax/VAT ID" v-model="variables.vat_id" :required="Rapidez::config('customer/address/taxvat_show', '0') == 'req'" />
@endif
@if(Rapidez::config('customer/address/telephone_show', 'req'))
<x-rapidez::input name="telephone" v-model="variables.telephone" :required="Rapidez::config('customer/address/telephone_show', 'req') == 'req'" />
@endif
Expand Down
12 changes: 11 additions & 1 deletion resources/views/account/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<x-rapidez::recaptcha location="customer_create"/>
<graphql-mutation
v-cloak
query="mutation customer ($firstname: String!, $lastname: String!, $email: String!, $password: String) { createCustomerV2 ( input: { firstname: $firstname, lastname: $lastname, email: $email, password: $password } ) { customer { email } } }"
query="mutation customer ($firstname: String!, $lastname: String!, $email: String!, $password: String, $taxvat: String) { createCustomerV2 ( input: { firstname: $firstname, lastname: $lastname, email: $email, password: $password, taxvat: $taxvat } ) { customer { email } } }"
redirect="{{ route('account.overview') }}"
:callback="registerCallback"
:recaptcha="{{ Rapidez::config('recaptcha_frontend/type_for/customer_create') == 'recaptcha_v3' ? 'true' : 'false' }}"
Expand Down Expand Up @@ -42,6 +42,16 @@
required
/>

@if(Rapidez::config('customer/create_account/vat_frontend_visibility', 0))
<x-rapidez::input
name="taxvat"
label="Tax/VAT ID"
placeholder="Tax/VAT ID"
type="text"
v-model="variables.taxvat"
/>
@endif

<x-rapidez::button type="submit" class="w-full">
@lang('Register')
</x-rapidez::button>
Expand Down

0 comments on commit d8277ae

Please sign in to comment.