cart responsive, Checkout from cart

This commit is contained in:
Kevin Adametz 2020-08-14 18:32:41 +02:00
parent bde1095014
commit fb27009339
17 changed files with 501 additions and 319 deletions

View file

@ -255,6 +255,8 @@
@if($isView === 'customer-add')
{{ Form::hidden('billing_email_1', $billing_email) }}
{{ Form::hidden('billing_email-confirm_1', $billing_email) }}
{{ Form::hidden('faker_mail', $shopping_user->faker_mail) }}
<div class="form-row">
<div class="form-group col-md-6">
@ -271,6 +273,7 @@
<div class="form-group col-md-6">
<label class="form-label" for="billing_email">{{ __('E-Mail Address') }}*</label>
{{ Form::text('billing_email', $shopping_user->billing_email, array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'billing_email')) }}
faker_mail
</div>
<div class="form-group col-md-6">
<label class="form-label" for="billing_email-confirm">{{ __('Confirm E-Mail') }}</label>

View file

@ -12,7 +12,7 @@
<!-- /PAGE HEADER -->
<style>
div.shop-item {
/* div.shop-item {
margin-bottom:30px;
border: 1px solid #ddd;
}
@ -52,7 +52,8 @@
color: #9aa983;
font-size: 1.2em;
}
.table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
.table-mi-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
border: 1px solid #ddd !important;
}
@ -97,13 +98,85 @@
padding-top: 10px;
}
}
*/
select.form-control:not([size]):not([multiple]) {
height: 38px;
color: #6f6f6f;
font-weight: 600;
}
.yard-items-head {
border-bottom: 1px solid #ddd;
padding-bottom: 8px;
margin-bottom: 8px;
}
.yard-item {
position: relative;
border-bottom: 1px solid #ddd;
padding-bottom: 8px;
}
.yard-item a.shop-item-hl {
color: #9aa983;
font-size: 1.1em;
font-weight: bold;
}
.yard-item .options {
margin-top: 4px;
}
.yard-item a.auto-delete-product {
font-size: 0.7em;
font-weight: bold;
text-transform: uppercase;
}
.yard-item .quantity {
position: relative;
}
.quantity-select {
text-align: right;
}
.quantity-select select.form-control:not([size]):not([multiple]) {
width: auto;
min-width: 5em;
display: inline-block;
}
.yard-item .price-total {
margin-top: 6px;
white-space: nowrap;
}
.yard-item .font-semi-bold {
color: #393939;
font-weight: 500;
}
.yard-item .font-semi-bold .small {
font-size: 1rem;
}
.yard-item .font-bold {
color:#393939;
font-weight: bold;
}
.price-single {
white-space: nowrap;
}
.btn-default {
border: none;
font-size: 0.9em;
}
</style>
<!-- -->
<section>
<div class="container">
<h1>Warenkorb</h1>
<h1 class="mb-0">Warenkorb</h1>
<!-- EMPTY CART -->
<!-- <div class="panel panel-default">
@ -119,9 +192,11 @@
<div class="row">
<!-- LEFT -->
<div class="col-lg-9 col-sm-7">
<div class="col-lg-9 col-md-8 col-sm-12">
<h4 class="weight-400">Du hast {{ Yard::instance('shopping')->count() }} Artikel in Deinem Warenkorb</h4>
<h3>Du hast {{ Yard::instance('shopping')->count() }} Artikel in Deinem Warenkorb</h3>
@if(Yard::instance('shopping')->content()->count())
<!-- CART -->
@ -130,101 +205,90 @@
<!-- cart content -->
<div id="cartContent">
<!-- Shopping cart table -->
<div class="table-responsive">
<table class="table table-bordered m-0">
<thead>
<tr>
<!-- Set columns width -->
<th colspan="2" class="text-left py-3 px-4" style="min-width: 400px;">Produkt</th>
<th class="text-right py-3 px-4" style="width: 120px;">Preis</th>
<th class="text-center py-3 px-4" style="width: 60px;">Anzahl</th>
<th class="text-right py-3 px-4" style="width: 100px;">Summe</th>
<th class="text-center align-middle py-3 px-0" style="width: 40px;">#</th>
</tr>
</thead>
<tbody>
<div class="yard-items-head">
<div class="row hidden-sm-down">
@foreach(Yard::instance('shopping')->content() as $row)
<div class="col-xs-3 col-sm-2">
@php($product = \App\Models\Product::find($row->id))
<tr class="item yard">
<td>
@if($row->options->has('image'))
<img src="{{ route('product_image', [$row->options->image]) }}" width="80" alt="">
@else
<img src="{{ asset('/assets/images/1x1.png') }}" width="80" alt="">
@endif
</td>
<td class="p-4">
<a href="{{ url('/produkte/alle-produkte/'.$row->options->slug) }}" class="shop-item-hl ">
<span>{{ $row->name }}</span>
<div style="font-size: 13px; color:#1d1d1d; font-weight: 500;">Inhalt: {{ $product->contents }}</div>
<div style="font-size: 13px; color:#1d1d1d; font-weight: 500;">Art.-Nr.: {{ $product->number }}</div>
<div style="font-size: 13px; color:#6e6e6e; font-weight: 400;"><em>Lieferzeit: 1-3 Werktage</em></div>
</a>
</td>
<td class="text-right font-weight-semibold align-middle p-2">
<span>{{ $row->price() }} </span>
<div style="font-size: 11px; color:#1d1d1d; font-weight: 500;">{{$product->getBasePriceFormattedFull()}}</div>
<div style="font-size: 11px; color:#1d1d1d; font-weight: 500;">inkl. {{ number_format($row->taxRate, 0)}}% MwSt.</div>
</td>
<td class="align-middle p-2">
<input type="number" value="{{ $row->qty }}" name="quantity[{{$row->rowId}}]" maxlength="3" max="999" min="1" />
</td>
<td class="text-right font-weight-semibold align-middle p-2">
<div class=""><strong>{{ $row->subtotal() }} </strong></div>
</td>
<td class="text-left p-2">
<a style="margin: 0" href="{{ url(Util::getPostRoute().'card/remove', $row->rowId) }}" class="remove_item"><i class="fa fa-times"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{-- <div class="box-border-shadow">
<!-- cart header -->
<div class="item head clearfix">
<span class="cart_img"></span>
<span class="product_name size-15 bold">Produkt</span>
<span class="remove_item size-15 bold"></span>
<span class="total_price size-15 bold">Preis</span>
<span class="qty size-15 bold">Anzahl</span>
</div>
@foreach(Yard::instance('shopping')->content() as $row)
@php($product = \App\Models\Product::find($row->id))
<div class="item yard">
<div class="cart_img pull-left width-100 padding-10 text-left">
@if($row->options->has('image'))
<img src="{{ route('product_image', [$row->options->image]) }}" width="80" alt="">
@else
<img src="{{ asset('/assets/images/1x1.png') }}" width="80" alt="">
@endif
</div>
<a href="{{ url('/produkte/alle-produkte/'.$row->options->slug) }}" class="product_name">
<span>{{ $row->name }}</span>
<div style="font-size: 13px; color:#1d1d1d; font-weight: 500;">{{$product->getBasePriceFormattedFull()}}</div>
<div style="font-size: 13px; color:#6e6e6e; font-weight: 400;"><em>Lieferzeit: 1-3 Werktage</em></div>
<div class="col-xs-9 col-sm-10">
<div class="row">
<div class="col-sm-6 col-md-7">
Artikel
</div>
<div class="col-sm-3 col-md-2 text-left">
Einzelpreis
</div>
<div class="ol-sm-3 col-md-3 text-right">
Anzahl
</div>
</div>
</div>
</div>
</div>
</a>
<a href="{{ url(Util::getPostRoute().'card/remove', $row->rowId) }}" class="remove_item"><i class="fa fa-times"></i></a>
<div class="total_price"><span>{{ $row->subtotal() }} </span> </div>
<div class="qty"><input type="number" value="{{ $row->qty }}" name="quantity[{{$row->rowId}}]" maxlength="3" max="999" min="1" /> &times; {{ $row->price() }} </div>
<div class="clearfix"></div>
@foreach(Yard::instance('shopping')->content() as $row)
@php($product = \App\Models\Product::find($row->id))
<div class="row yard-item">
<div class="col-xs-3 col-sm-2">
<a href="{{ url('/produkte/alle-produkte/'.$row->options->slug) }}" title="" class="image">
@if($row->options->has('image'))
<img src="{{ route('product_image', [$row->options->image]) }}" class="img-responsive" alt="">
@else
<img src="{{ asset('/assets/images/1x1.png') }}" width="80" alt="">
@endif
</a>
</div>
<div class="col-xs-9 col-sm-10">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-7 description">
<a href="{{ url('/produkte/alle-produkte/'.$row->options->slug) }}" class="shop-item-hl"><span>{{ $row->name }}</span></a>
<div style="font-size: 13px; color:#1d1d1d; font-weight: 500;">Inhalt: {{ $product->contents }}</div>
<div style="font-size: 13px; color:#1d1d1d; font-weight: 500;">Art.-Nr.: {{ $product->number }}</div>
<div style="font-size: 13px; color:#6e6e6e; font-weight: 400;"><em>Lieferzeit: 1-3 Werktage</em></div>
<div class="options">
<a class="auto-delete-product" href="{{ url(Util::getPostRoute().'card/remove', $row->rowId) }}"><i class="fa fa-times"></i> Artikel entfernen</a>
</div>
</div>
<div class="col-xs-6 col-sm-3 col-md-2 text-left font-semi-bold price-single">
<div style="">{{ $row->price() }} &euro;</div>
<div class="small">{{$product->getBasePriceFormattedFull()}}</div>
<div class="small">inkl. {{ number_format($row->taxRate, 0)}}% MwSt.</div>
<!---->
</div>
<div class="col-xs-6 col-sm-3 col-md-3 quantity">
<div class="quantity-select">
<select class="form-control" name="quantity[{{$row->rowId}}]" onchange="this.form.submit()">
{!! HTMLHelper::getOptionRange($row->qty, 1, 50) !!}
</select>
</div>
<div class="price-total text-right">
<span class="font-bold text-price-total">{{ $row->subtotal() }}</span> &euro;
</div>
</div>
</div>
</div>
</div>
@endforeach
</div>--}}
<a href="{{url(Util::getPostRoute().'card/delete')}}" class="btn btn-default btn-sm margin-top-20 margin-right-10 pull-left"><i class="glyphicon glyphicon-remove"></i> Warenkorb löschen</a>
<button type="submit" class="btn btn-sm btn-default margin-top-20 margin-left-0 pull-right pull-left-xs"><i class="glyphicon glyphicon-refresh"></i> Warenkorb aktualisieren</button>
@endforeach
<a href="{{url(Util::getPostRoute().'card/delete')}}" class="btn btn-default btn-xs pull-left"><i class="glyphicon glyphicon-remove"></i> Warenkorb löschen</a>
<button type="submit" class="btn btn-xs btn-default pull-right "><i class="glyphicon glyphicon-refresh"></i> Warenkorb aktualisieren</button>
<div class="clearfix"></div>
</div>
{!! Form::close() !!}
@ -233,25 +297,15 @@
</div>
<style>
.select2-container{
margin-bottom: 0px;
}
.select2-container .select2-selection--single .select2-selection__rendered
{
padding: 8px 20px;
height: 36px;
}
</style>
<!-- RIGHT -->
<div class="col-lg-3 col-sm-5">
<div class="col-sm-8 col-sm-offset-4 col-md-4 col-md-offset-0 col-lg-3 col-lg-offset-0">
@if(Yard::instance('shopping')->content()->count())
<h3>Warenkorb Summe</h3>
<div class="toggle-transparent toggle-bordered-full clearfix">
<div class="toggle active">
<div class="toggle active cart-content">
<div class="toggle-content">
<div class="clearfix mb-2">
@ -264,8 +318,8 @@
<div class=" small">Versandland:</div>
<div class="small">
<form action="{{ url(Util::getPostRoute().'card/show') }}" method="GET" style="margin-bottom: 0;">
<select name="selected_country" class="select2" onchange="this.form.submit()">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
<select name="selected_country" class="form-control" onchange="this.form.submit()">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId(), false) !!}
</select>
</form>
</div>

View file

@ -98,6 +98,17 @@
display: none;
}
select.form-control:not([size]):not([multiple]) {
height: 38px;
color: #6f6f6f;
font-weight: 600;
}
.info-small {
font-size: 0.8em;
font-style: italic;
}
</style>
<section>
@ -135,7 +146,11 @@
<div class="m-checkout">
{!! Form::open(['url' => route('checkout.checkout_card_final'), 'class' => 'row clearfix', 'id'=>'']) !!}
{!! Form::open(['url' => route('checkout.checkout_card_final'), 'class' => 'row clearfix', 'id'=>'checkout_card_final']) !!}
{!! Form::hidden('selected_country') !!}
{!! Form::hidden('is_for', $shopping_user->is_for) !!}
{!! Form::hidden('is_from', $shopping_user->is_from) !!}
@if (\Session::has('elv-managemandate'))
@ -243,11 +258,12 @@
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
<label class="mt-0 fs-14 fw-400" for="billing_state">Land *</label>
<select id="billing_state" name="billing_state" class="form-control select2 required" disabled="true">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
<label class="mt-0 fs-14 fw-400" for="billing_state">Land * {{$shopping_user->billing_state}}</label>
<select id="billing_state" name="billing_state" class="form-control required">
{!! HTMLHelper::getCountriesForShipping($shopping_user->billing_state) !!}
</select>
<input type="hidden" name="billing_country_id" value="{{Yard::instance('shopping')->getShippingCountryCountryId()}}">
<span class="info-small" id="show_shipping_country_info">Bei der Änderung des Versandlandes werden die Versandkosten neu berechnet.</span>
</div>
</div>
@ -398,11 +414,12 @@
<div class="row">
<div class="col-md-12 col-sm-12">
<label class="mt-0 fs-14 fw-400" for="shipping_state">Land *</label>
<select id="shipping_state" name="shipping_state" class="form-control select2 required" disabled="true">
{!! HTMLHelper::getCountriesForShipping(Yard::instance('shopping')->getShippingCountryId()) !!}
<label class="mt-0 fs-14 fw-400" for="shipping_state">Land * {{$shopping_user->shipping_state}}</label>
<select id="shipping_state" name="shipping_state" class="form-control required">
{!! HTMLHelper::getCountriesForShipping($shopping_user->shipping_state) !!}
</select>
<input type="hidden" name="shipping_country_id" value="{{Yard::instance('shopping')->getShippingCountryCountryId()}}">
<span class="info-small">Bei der Änderung des Landes werden die Versandkosten neu berechnet.</span>
</div>
</div>
@ -681,9 +698,6 @@
<button type="submit" class="btn btn-primary btn-lg btn-block size-18 btn-text-500 mt-4 faa-parent animated-hover"><i class="fa fa-mail-forward faa-horizontal"></i> Jetzt kaufen</button>
<hr><p class="text-center" style="line-height: 1.2em;"><em class="small text-center"> <i class="fa fa-lock"></i> Sind alle Deine Angaben vollsätndig ausgefüllt, klicke auf "Jetzt kaufen" und Du wist zu unserem Zahlungsanbieter weitergeleitet, die Verbindung wird ist SSL verschlüsselt.</em></p>
</div>
</div>
</div>
@ -697,4 +711,90 @@
<!-- /CART -->
@endsection
@section('scripts')
<script>
/** CHECKOUT
** *********************** **/
// New Account show|hide
jQuery("#accountswitch").bind("click", function() {
jQuery('#newaccount').slideToggle(200);
});
$('#billing_state').on('change', function (){
$('input[name="selected_country"]').val('change');
$('form#checkout_card_final').submit();
});
$('#shipping_state').on('change', function (){
$('input[name="selected_country"]').val('change');
$('form#checkout_card_final').submit();
});
function showShippingCountryFor($for){
if($for === 'billing'){
$('#show_shipping_country_info').show();
}
if($for === 'shipping'){
$('#show_shipping_country_info').hide();
}
}
// Shipping Address show|hide
jQuery("#shipswitch").bind("click", function() {
jQuery('#shipping').slideToggle(200, function() {
// scroll down to shipping area.
if(jQuery('#shipping').is(":visible")) {
_scrollTo('#shipping', 150);
showShippingCountryFor('shipping');
}else{
showShippingCountryFor('billing');
}
});
});
if(!jQuery('#shipswitch').is(':checked')){
jQuery('#shipping').show();
showShippingCountryFor('shipping');
}else{
showShippingCountryFor('billing');
}
jQuery('.quick-cart-box-close').on('click', function () {
jQuery('.quick-cart-box').css('display', 'none');
});
function showCreditCardPayment(val){
if(val === 'cc'){
$('#creditcard-box-holder').show('slow');
}else{
$('#creditcard-box-holder').hide('slow');
}
}
showCreditCardPayment(jQuery('input[name="payment_method"]:checked').val());
jQuery('input[name="payment_method"]').on('change', function () {
showCreditCardPayment($(this).val());
});
function showSEPAPayment(val){
if(val === 'elv'){
$('#sepa-box-holder').show('slow');
}else{
$('#sepa-box-holder').hide('slow');
}
}
showSEPAPayment(jQuery('input[name="payment_method"]:checked').val());
jQuery('input[name="payment_method"]').on('change', function () {
showSEPAPayment($(this).val());
});
</script>
@endsection

View file

@ -78,63 +78,7 @@
<script type="text/javascript" src="{{ asset('/assets/plugins/slider.revolution/js/jquery.themepunch.revolution.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('/assets/js/view/demo.revolution_slider.js') }}"></script>
@yield('scripts')
<script>
/** CHECKOUT
** *********************** **/
// New Account show|hide
jQuery("#accountswitch").bind("click", function() {
jQuery('#newaccount').slideToggle(200);
});
// Shipping Address show|hide
jQuery("#shipswitch").bind("click", function() {
jQuery('#shipping').slideToggle(200, function() {
// scroll down to shipping area.
if(jQuery('#shipping').is(":visible")) {
_scrollTo('#shipping', 150);
}
});
});
if(!jQuery('#shipswitch').is(':checked')){
jQuery('#shipping').show();
}
jQuery('.quick-cart-box-close').on('click', function () {
jQuery('.quick-cart-box').css('display', 'none');
});
function showCreditCardPayment(val){
if(val === 'cc'){
$('#creditcard-box-holder').show('slow');
}else{
$('#creditcard-box-holder').hide('slow');
}
}
showCreditCardPayment(jQuery('input[name="payment_method"]:checked').val());
jQuery('input[name="payment_method"]').on('change', function () {
showCreditCardPayment($(this).val());
});
function showSEPAPayment(val){
if(val === 'elv'){
$('#sepa-box-holder').show('slow');
}else{
$('#sepa-box-holder').hide('slow');
}
}
showSEPAPayment(jQuery('input[name="payment_method"]:checked').val());
jQuery('input[name="payment_method"]').on('change', function () {
showSEPAPayment($(this).val());
});
</script>
{{--