70 lines
4.1 KiB
PHP
70 lines
4.1 KiB
PHP
@foreach($cart_contents as $cart)
|
|
@php
|
|
$modules = product_setting()->modules ?? [];
|
|
@endphp
|
|
<tr
|
|
data-row_id="{{ $cart->rowId }}"
|
|
data-product_id="{{ $cart->id }}"
|
|
data-has_serial="{{ $cart->options->has_serial ?? 0 }}"
|
|
data-serials='@json($cart->options->serial_numbers ?? [])'
|
|
data-update_route="{{ route('business.carts.update', $cart->rowId) }}"
|
|
data-destroy_route="{{ route('business.carts.destroy', $cart->rowId) }}">
|
|
<td class='text-start'>
|
|
<img class="table-img" src="{{ asset($cart->options->product_image ?? 'assets/images/products/box.svg') }}">
|
|
</td>
|
|
<td class='text-start'>{{ $cart->name }}</td>
|
|
<td class='text-start'>{{ $cart->options->product_code }}</td>
|
|
<td class='text-start'>{{ $cart->options->product_unit_name }}</td>
|
|
@if (is_module_enabled($modules, 'show_product_batch_no'))
|
|
<td>
|
|
<input type="text" name="batch_no" class="batch_no sales-input" value="{{ $cart->options->batch_no ?? '' }}">
|
|
</td>
|
|
@endif
|
|
@if (is_module_enabled($modules, 'show_product_expire_date'))
|
|
<td>
|
|
@if (isset($modules['expire_date_type']) && ($modules['expire_date_type'] == 'dmy' || is_null($modules['expire_date_type'])))
|
|
<input type="month" name="expire_date" value="{{ date('Y-m', strtotime($cart->options->expire_date ?? '')) }}" class="form-control expire_date">
|
|
@else
|
|
<input type="date" name="expire_date" value="{{ date('Y-m-d', strtotime($cart->options->expire_date ?? '')) }}" class="form-control expire_date">
|
|
@endif
|
|
</td>
|
|
@endif
|
|
@usercan('purchases.price')
|
|
<td class='text-center'>
|
|
<input type="number" step="any" value="{{ $cart->price }}" class="custom-number-input price" placeholder="{{ __('0') }}">
|
|
</td>
|
|
@endusercan
|
|
@if (moduleCheck('SerialCodeAddon'))
|
|
<td class="serial-cell serial-option">
|
|
<button type="button" class="serial-cell-button" @if(($cart->options->has_serial ?? 0) != 1) disabled @endif data-bs-toggle="modal" data-bs-target="#serialModal">
|
|
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M4 7H18" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round"/>
|
|
<path d="M23 7H23.0105" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M23 14H23.0105" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M23 21H23.0105" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M4 14H18" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round"/>
|
|
<path d="M4 21H18" stroke="var(--clr-primary)" stroke-width="2" stroke-linecap="round"/>
|
|
</svg>
|
|
</button>
|
|
</td>
|
|
@endif
|
|
<td class='text-start'>
|
|
<div class="d-flex align-items-center justify-content-center gap-2">
|
|
<button class="incre-decre minus-btn" @if(($cart->options->has_serial ?? 0) == 1) disabled @endif>
|
|
<i class="fas fa-minus icon"></i>
|
|
</button>
|
|
<input type="number" step="any" value="{{ $cart->qty }}" class="dynamic-width cart-qty" @if(($cart->options->has_serial ?? 0) == 1) disabled readonly @endif>
|
|
<button class="incre-decre plus-btn" @if(($cart->options->has_serial ?? 0) == 1) disabled @endif>
|
|
<i class="fas fa-plus icon"></i>
|
|
</button>
|
|
</div>
|
|
</td>
|
|
<td class="cart-subtotal">{{ currency_format($cart->subtotal, currency: business_currency()) }}</td>
|
|
<td>
|
|
<button class='x-btn remove-btn'>
|
|
<img src="{{ asset('assets/images/icons/x.svg') }}" alt="">
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|