mivita/resources/views/components/abo/product-table.blade.php
2025-08-12 18:01:59 +02:00

117 lines
No EOL
6.1 KiB
PHP

@props([
'products' => [],
'productType' => 'base', // 'base' oder 'upgrade'
'formRoute' => '',
'formStep' => 3
])
{!! Form::open(['action' => route($formRoute, $formStep), 'method' => 'POST', 'class' => '']) !!}
@include('components.abo.product-table-styles')
<div class="card-body">
<div class="row">
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('payment.ordering_country') }}</div>
{{ App\Services\UserService::getOrderInfo('billing_state') }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('payment.country_of_delivery') }}</div>
{{ App\Services\UserService::getOrderInfo('shipping_state') }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('payment.VAT') }}</div>
{{ App\Services\UserService::getOrderInfo('tax_free') }}
</div>
<div class="col-md-3 mb-3">
<div class="text-muted small">{{ __('payment.reverse_charge_procedure') }}</div>
{{ App\Services\UserService::getOrderInfo('user_reverse_charge') }}
</div>
</div>
@if($productType === 'base')
<div class="alert alert-warning">
<strong>{!! __('abo.abo_type_info', ['base'=>get_abo_type_badge('base'), 'upgrade'=>get_abo_type_badge('upgrade')]) !!}</strong>
</div>
@if(isset($error))
<div class="alert alert-danger">
<strong>{{ $error }}</strong>
</div>
@endif
@endif
@if(count($products) > 0)
<div class="table-responsive">
<table class="table table- m-0">
<thead>
<tr>
<th>{{ __('abo.' . $productType . '_product') }}</th>
<th>&nbsp;</th>
<th class="text-right">{{ __('order.unit_price') }}</th>
</tr>
</thead>
<tbody>
@foreach($products as $product)
<tr>
<td class="text-center align-middle px-0" data-label="{{ __('abo.' . $productType . '_product') }}">
<div class="no-line-break input-group-min-w">
<div class="input-group d-inline-flex w-auto">
<span class="input-group-prepend">
<button type="button" class="btn btn-secondary icon-btn md-btn-extra remove-product-qty"
data-row-id="{{ $product->id }}"
data-product-id="{{ $product->id }}">-</button>
</span>
<input type="text"
class="form-control text-center input-extra table-input-event-onchange"
name="{{ $productType }}_product_qty[{{ $product->id }}]"
data-row-id="{{ $product->id }}"
data-product-id="{{ $product->id }}"
value="0">
<span class="input-group-append">
<button type="button" class="btn btn-secondary icon-btn md-btn-extra add-product-qty"
data-row-id="{{ $product->id }}"
data-product-id="{{ $product->id }}">+</button>
</span>
</div>
</div>
</td>
<td class="p-4" data-label="">
<div class="media align-items-center product-inactive" id="product-{{ $product->id }}">
@if(count($product->images))
<img src="{{ route('product_image', [$product->images->first()->slug]) }}"
class="d-block ui-w-100 ui-bordered mr-4"
alt="{{ $product->getLang('name') }}">
@endif
<div class="media-body">
<h5 class="d-block text-dark">
{{$product->getLang('name')}}
<br>{!! get_abo_type_badge($productType) !!}
</h5>
{!! $product->getLang('copy') !!}
</div>
</div>
</td>
<td class="text-right font-weight-semibold align-middle p-4" data-label="{{ __('order.unit_price') }}">
<span class="no-line-break">
{{ $product->getFormattedPriceWith(\App\Services\UserService::getTaxFree(), false, \App\Services\UserService::$user_country) }}
</span>
@if(\App\Services\UserService::$user_country && \App\Services\UserService::$user_country->currency)
<span class="no-line-break">
{!! $product->getFormattedPriceCurrencyWith(\App\Services\UserService::getTaxFree(), false, \App\Services\UserService::$user_country) !!}
</span>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
<div class="card-footer">
<button type="submit" class="btn btn-secondary" name="action" value="next">{{ __('abo.confirm_and_next') }}</button>
</div>
{!! Form::close() !!}