Files
opensem/resources/views/Shop/Orders/order.blade.php
2024-01-21 11:42:42 +01:00

67 lines
2.4 KiB
PHP

@extends('Shop.layout.layout', [
'title' => __('Commande'),
])
@section('content')
<div class="row">
<div class="@if ($basket['count']) col-sm-12 col-lg-8 @else col-12 @endif">
@if (App\Repositories\Shop\Customers::isNotConnected())
<p>
<a href="#" id="customer" class="pr-5">Déja client ?</a>
<button class="btn btn-secondary" id="register">Créez mon compte</button>
</p>
<x-layout.collapse id="identification" title="Déjà client" class="identification rounded-lg" uncollapsed=true>
@include('Shop.auth.partials.login')
</x-layout.collapse>
<x-layout.collapse id="personal_data" title="Informations personnelles"
class="d-none personal_data rounded-lg" uncollapsed=true>
@include('Shop.auth.partials.register')
</x-layout.collapse>
@else
{{ Form::open(['route' => 'Shop.Orders.store', 'id' => 'order-form', 'autocomplete' => 'off']) }}
@include('Shop.Orders.partials.registered')
{!! Form::close() !!}
@endif
</div>
@if ($basket['count'])
<div class="col-sm-12 col-lg-4">
<x-card class='shadow'>
<div id="basketTotal">
@include('Shop.Baskets.partials.basketTotal', ['basket' => $basket])
</div>
</x-card>
</div>
@endif
</div>
@endsection
@include('load.layout.chevron')
@push('js')
<script>
$('#customer').click(function() {
$(".personal_data").addClass('d-none');
$('.identification').removeClass('d-none');
$('#identification').collapse('show');
});
$('#register').click(function() {
$('.identification').addClass('d-none');
$(".personal_data").removeClass('d-none');
$('#personal_data').collapse('show');
});
function refreshBasketTotal(deliveryId, deliveryTypeId) {
options = deliveryId + '/' + deliveryTypeId;
$.get("{{ Route('Shop.Basket.getBasketTotal') }}/" + options, function(data) {
$('#basketTotal').html(data);
});
}
initChevron();
</script>
@endpush