@extends('layouts.app') @section('content') @if (! CartCollection::isEmpty()) @endif @if ($draft)
Refresh
@if ($queriedProducts)
@forelse($queriedProducts as $product) @empty @endforelse
Produk Harga Satuan ({{ $draft->type }}) Action
{{ $product->name }} {{ formatRp($draft->type == 'cash' ? $product->cash_price : $product->credit_price) }}
{{ csrf_field() }}
Produk tidak ditemukan dengan keyword : {{ request('query') }}
@endif
@forelse($draft->items() as $key => $item) @empty @endforelse
# Nama Item Harga Satuan Diskon per Item Qty Subtotal Action
{{ $key + 1 }} {{ $item->name }} {{ formatRp($item->price) }} {{ Form::open(['route' => ['cart.update-draft-item', $draft->draftKey], 'method' => 'patch']) }} {{ Form::hidden('item_key', $key) }} {{ Form::hidden('qty', $item->qty) }} {{ Form::text('item_discount', $item->item_discount, ['id' => 'item_discount-' . $key, 'style' => 'width:100px;text-align:right']) }} {{ Form::submit('update-item-' . $key, ['style'=>'display:none']) }} {{ Form::close() }} {{ Form::open(['route' => ['cart.update-draft-item', $draft->draftKey], 'method' => 'patch']) }} {{ Form::hidden('item_key', $key) }} {{ Form::hidden('item_discount', $item->item_discount) }} {{ Form::number('qty', $item->qty, ['id' => 'qty-' . $key, 'style' => 'width:50px;text-align:center']) }} {{ Form::submit('update-item-' . $key, ['style'=>'display:none']) }} {{ Form::close() }} {{ formatRp($item->subtotal) }} {!! FormField::delete([ 'route' => ['cart.remove-draft-item', $draft->draftKey], 'onsubmit' => 'Yakin ingin menghapus Item ini?', 'class' => '', ], 'x', ['id' => 'remove-item-' . $key, 'class' => 'btn btn-danger btn-xs'], ['item_index' => $key]) !!}
Subtotal : {{ formatRp($draft->getSubtotal()) }}
Diskon Total : {{ formatRp($draft->getDiscountTotal()) }}
Total : {{ formatRp($draft->getTotal()) }}
@endif @endsection