Promotion Frontend dynamic

This commit is contained in:
Kevin Adametz 2021-11-26 18:23:10 +01:00
parent c9e1545693
commit 1cc8e025a1
29 changed files with 551 additions and 163 deletions

View file

@ -1,4 +1,3 @@
<section>
<div class="row">
<div class="col-12 text-left">
<h2 class="mt-3">Warenkorb</h2>
@ -23,15 +22,12 @@
</div>
</div>
</div>
@foreach ([2, 4, 5] as $id)
@php($product = \App\Models\Product::find($id))
@foreach(Yard::instance('shopping')->getContentByOrder() as $row)
@php($product = \App\Models\Product::find($row->id))
<div class="row yard-item">
<div class="col-3 col-sm-2">
@if ($product->images)
@if($image = $product->images->first())
<img src="{{ route('product_image', [$image->slug]) }}" class="d-block ui-w-80 ui-bordered mr-4" alt="">
@endif
@if($row->options->has('image'))
<img src="{{ route('product_image', [$row->options->image]) }}" class="d-block ui-w-80 ui-bordered mr-4" alt="">
@else
<img src="{{ asset('/assets/images/1x1.png') }}" class="d-block ui-w-80 ui-bordered mr-4" alt="">
@endif
@ -42,7 +38,7 @@
<div class="col-12 col-sm-6 col-md-7 description">
<div class="media-body">
<div class="d-block text-body"
style="font-size: 15px; font-weight: 500;">{{ $product->name }}
style="font-size: 15px; font-weight: 500;">{{ $row->name }}
</div>
<div class="text-body">
<div>Inhalt: {{ $product->contents }}</div>
@ -50,54 +46,54 @@
</div>
</div>
<div class="options">
@if(!$row->options->free_product)
<a href="#"
class="auto-delete-product remove_item_form_cart product-tooltip"
data-row-id="{{ $product->id }}"
data-row-id="{{$row->rowId}}"
data-product-id="{{ $product->id }}"><i
class="fa fa-times"></i> Artikel entfernen</a>
@else
gratis Produkt
@endif
</div>
</div>
<div class="col-6 col-sm-3 col-md-2 text-left font-semi-bold price-single">
<div class="no-line-break">
{{ $product->getFormattedPrice() }} &euro;*</div>
{{ Yard::instance('shopping')->rowPrice($row, 2) }} &euro;*</div>
</div>
<div class="col-6 col-sm-3 col-md-3 quantity">
@if(!$row->options->free_product)
<div class="quantity-select">
<input type="number"
class="form-control text-center cart-input-event-onchange"
data-row-id="{{ $product->id }}"
data-product-id="{{ $product->id }}" value="1"
name="quantity[{{ $product->id }}]" maxlength="3" max="999"
data-row-id="{{$row->rowId}}"
data-product_id="{{ $product->id }}" value="{{ $row->qty }}"
name="quantity[{{ $row->qty }}]" maxlength="3" max="999"
min="1">
</div>
<div class="price-total text-right">
<div class="no-line-break">
0 &euro;*
</div>
<div class="no-line-break">{{ Yard::instance('shopping')->rowSubtotal($row, 2) }} &euro;*</div>
</div>
@else
<div class="price-total text-right mt-0">
<div class="no-line-break">1 / 0,00 &euro;*</div>
</div>
@endif
</div>
</div>
</div>
<div class="col-12">
<hr class="mt-2 mb-2 light">
</div>
</div>
@endforeach
<div class="clearfix"></div>
</div>
</div>
<div class="mt-2 col-12">
<p class="small mb-2">Du hast xx Artikel in Deinem Warenkorb</p>
<p class="small mb-2">Du hast {{ Yard::instance('shopping')->count() }} Artikel in Deinem Warenkorb</p>
<button type="button" class="btn btn-default btn-sm" id="clear-products-basket"><i
class="ion ion-ios-trash"></i> Warenkorb löschen</button>
<hr class="">
</div>
</div>
</section>
</div>