Address Endpoint Fixed
This commit is contained in:
parent
eabb3e9f9c
commit
3bd237e656
|
|
@ -247,7 +247,7 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function
|
|||
Route::get('addresses/default/{id}', 'Webkul\Customer\Http\Controllers\AddressController@makeDefault')->name('make.default.address');
|
||||
|
||||
//Customer Address Delete
|
||||
Route::get('addresses/delete/{id}', 'Webkul\Customer\Http\Controllers\AddressController@destroy')->name('address.delete');
|
||||
Route::delete('addresses/delete/{id}', 'Webkul\Customer\Http\Controllers\AddressController@destroy')->name('address.delete');
|
||||
|
||||
/* Wishlist route */
|
||||
//Customer wishlist(listing)
|
||||
|
|
|
|||
|
|
@ -77,18 +77,22 @@
|
|||
</ul>
|
||||
|
||||
<div class="control-links mt-20">
|
||||
<span>
|
||||
<a href="{{ route('customer.address.edit', $address->id) }}">
|
||||
{{ __('shop::app.customer.account.address.index.edit') }}
|
||||
</a>
|
||||
</span>
|
||||
<span>
|
||||
<a href="{{ route('customer.address.edit', $address->id) }}">
|
||||
{{ __('shop::app.customer.account.address.index.edit') }}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<a href="{{ route('address.delete', $address->id) }}"
|
||||
onclick="deleteAddress('{{ __('shop::app.customer.account.address.index.confirm-delete') }}')">
|
||||
{{ __('shop::app.customer.account.address.index.delete') }}
|
||||
</a>
|
||||
</span>
|
||||
<a href="javascript:void(0);" onclick="deleteAddress('{{ __('shop::app.customer.account.address.index.confirm-delete') }}')">
|
||||
{{ __('shop::app.customer.account.address.index.delete') }}
|
||||
</a>
|
||||
|
||||
<form id="deleteAddressForm" action="{{ route('address.delete', $address->id) }}" method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
</form>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -105,8 +109,12 @@
|
|||
@push('scripts')
|
||||
<script>
|
||||
function deleteAddress(message) {
|
||||
if (!confirm(message))
|
||||
if (! confirm(message)) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
$('#deleteAddressForm').submit();
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -56,13 +56,14 @@
|
|||
{{ __('shop::app.customer.account.address.index.edit') }}
|
||||
</a>
|
||||
|
||||
<a
|
||||
class="card-link"
|
||||
href="{{ route('address.delete', $address->id) }}"
|
||||
onclick="deleteAddress('{{ __('shop::app.customer.account.address.index.confirm-delete') }}')">
|
||||
|
||||
<a class="card-link" href="javascript:void(0);" onclick="deleteAddress('{{ __('shop::app.customer.account.address.index.confirm-delete') }}')">
|
||||
{{ __('shop::app.customer.account.address.index.delete') }}
|
||||
</a>
|
||||
|
||||
<form id="deleteAddressForm" action="{{ route('address.delete', $address->id) }}" method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -77,8 +78,12 @@
|
|||
@push('scripts')
|
||||
<script>
|
||||
function deleteAddress(message) {
|
||||
if (!confirm(message))
|
||||
event.preventDefault();
|
||||
if (! confirm(message)) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
$('#deleteAddressForm').submit();
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
|
|
|||
Loading…
Reference in New Issue