Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
"prefer-stable": true,
"require": {
"php": "^8.0",
"illuminate/support": "^9.0|^10.0|^11.0|^12.0",
"illuminate/view": "^9.0|^10.0|^11.0|^12.0",
"rapidez/core": "^3.0"
"rapidez/core": "^3.4"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion resources/views/account/address-edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@section('account-content')
<graphql
query="{ customer { addresses { id firstname middlename lastname street city postcode country_code telephone company default_billing default_shipping } } }"
query="{ customer { addresses { id firstname middlename lastname street city postcode country_code region { region_id } telephone company default_billing default_shipping } } }"
check="(data) => data.customer.addresses.find(a => a.id == {{ request()->id }})"
redirect="{{ route('account.orders') }}"
>
Expand Down
2 changes: 2 additions & 0 deletions resources/views/account/addresses.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<th class="px-4">@lang('Address')</th>
<th class="px-4">@lang('Postcode')</th>
<th class="px-4">@lang('City')</th>
<th class="px-4">@lang('Region')</th>
<th class="px-4">@lang('Country')</th>
<th class="px-4">@lang('Phone')</th>
<th></th>
Expand All @@ -40,6 +41,7 @@
<td class="border px-4 py-2">@{{ additionalAddress.street[0] }} @{{ additionalAddress.street[1] }} @{{ additionalAddress.street[2] }} @{{ additionalAddress.street[3] }}</td>
<td class="border px-4 py-2">@{{ additionalAddress.postcode }}</td>
<td class="border px-4 py-2">@{{ additionalAddress.city }}</td>
<td class="border px-4 py-2">@{{ additionalAddress.region?.region }}</td>
<td class="border px-4 py-2">@{{ additionalAddress.country_code }}</td>
@if (Rapidez::config('customer/address/telephone_show', 'opt'))
<td class="border px-4 py-2">@{{ additionalAddress.telephone }}</td>
Expand Down
21 changes: 20 additions & 1 deletion resources/views/account/partials/address-form.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@props(['region' => 'region.region_id'])

<form slot-scope="{ variables, mutate, mutated }" v-on:submit.prevent="mutate">
<div class="grid grid-cols-12 gap-4">
<h2 class="col-span-12 font-bold text-2xl">@lang('Contact information')</h2>
Expand Down Expand Up @@ -107,12 +109,29 @@
<x-rapidez::input.select.country
name="country_code"
v-model="variables.country_code"
v-on:change="window.app.$emit('postcode-change', variables)"
v-on:change="$root.$nextTick(() => {
window.app.$emit('postcode-change', variables);
variables.region = {};
variables.{{ $region }} = null;
})"
class="w-full"
required
/>
</label>
</div>
<div class="col-span-12 sm:col-span-6 has-[.exists]:block hidden">
<label>
<x-rapidez::label>@lang('Region')</x-rapidez::label>
<x-rapidez::input.select.region
class="exists"
name="{{ $type }}_region"
dusk="{{ $type }}_region"
country="variables.country_code"
v-model="variables.{{ $region }}"
:$useRegionId
/>
</label>
</div>
<div class="col-span-12">
<x-rapidez::input.checkbox v-model="variables.default_billing">@lang('Default billing address')</x-rapidez::input.checkbox>
</div>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/account/partials/default-addresses.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ul>
<li>@{{ (billing = data.customer.addresses.find(a => a.default_billing == true)).firstname }} @{{ billing.lastname }}</li>
<li>@{{ billing.street[0] }} @{{ billing.street[1] }} @{{ billing.street[2] }}</li>
<li>@{{ billing.postcode }} @{{ billing.city }} @{{ billing.country_code }}</li>
<li>@{{ billing.postcode }} @{{ billing.city }} @{{ billing.region?.region }} @{{ billing.country_code }}</li>
<li>T: @{{ billing.telephone }}</li>
</ul>
@isset($edit)
Expand All @@ -23,7 +23,7 @@
<ul>
<li>@{{ (shipping = data.customer.addresses.find(a => a.default_shipping == true)).firstname }} @{{ shipping.lastname }}</li>
<li>@{{ shipping.street[0] }} @{{ shipping.street[1] }} @{{ shipping.street[2] }}</li>
<li>@{{ shipping.postcode }} @{{ shipping.city }} @{{ shipping.country_code }}</li>
<li>@{{ shipping.postcode }} @{{ shipping.city }} @{{ shipping.region?.region }} @{{ shipping.country_code }}</li>
<li>T: @{{ shipping.telephone }}<br></li>
</ul>
@isset($edit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mutation address (
$telephone: String,
$street: [String],
$country_code: CountryCodeEnum,
$region: CustomerAddressRegionInput,
$city: String,
$postcode: String,
$default_billing: Boolean,
Expand All @@ -20,6 +21,7 @@ mutation address (
telephone: $telephone,
street: $street,
country_code: $country_code,
region: $region,
city: $city,
postcode: $postcode,
default_billing: $default_billing,
Expand Down
2 changes: 2 additions & 0 deletions resources/views/account/partials/queries/address-edit.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ mutation address (
$telephone: String,
$street: [String],
$country_code: CountryCodeEnum,
$region: CustomerAddressRegionInput,
$city: String,
$postcode: String,
$default_billing: Boolean,
Expand All @@ -21,6 +22,7 @@ mutation address (
telephone: $telephone,
street: $street,
country_code: $country_code,
region: $region,
city: $city,
postcode: $postcode,
default_billing: $default_billing,
Expand Down
5 changes: 5 additions & 0 deletions resources/views/account/partials/queries/overview.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ query customerOverview($ordersPageSize: Int = 5 $ordersCurrentPage: Int = 1) {
city
postcode
country_code
region {
region
region_code
region_id
}
telephone
company
vat_id
Expand Down