Shopping cart

@if ($cartView)
@php $totalPriceProduct = 0; @endphp @foreach ($cart_items as $item) @php $mrp = $item['variation']->mrp ?? $item->product->base_mrp; $price = $item['variation']->price ?? $item->product->base_price; $percentOff = $mrp > 0 && $price > 0 ? round((($mrp - $price) / $mrp) * 100) : 0; @endphp @php $attrs = []; foreach ($item['variation']->variation_attributes as $attr) { $attrName = $attr->attribute->attribute->name ?? ''; $attrValue = $attr->attribute->name ?? ''; if ($attrName && $attrValue) { $attrs[] = $attrName . ': ' . $attrValue; } } $variation_image = $item['variation']->image ?? null; @endphp @php $attrs = []; @endphp @foreach ($item['variation']->variation_attributes as $attr) @php $attrName = $attr->attribute->attribute->name ?? ''; $attrValue = $attr->attribute->name ?? ''; $attrs[] = $attrName . ': ' . $attrValue; @endphp @endforeach
{{-- @dd($item['product']) --}} @php $totalPriceProduct += (int) $price * (int) $item['quantity']; @endphp @endforeach
PRODUCT PRICE QUANTITY TOTAL
× @if (count($attrs) > 0) {{ $item['product']->product_name }} @else {{ $item['product']->product_name }} @endif {{ $item['product']->product_name }} @if (count($attrs) > 0) ({{ implode(', ', $attrs) }}) @endif ₹{{ number_format($price, 0, '.', ',') }}
@if ($item['quantity'] + 1 > $item['variation']->stock) @else @endif
₹{{ number_format((int) $price * (int) $item['quantity'], 0, '.', ',') }}
{{-- @if (count($cart_items) != 0) @endif --}}
CART TOTALS
SUBTOTAL ₹{{ $totalPriceProduct }}
COUPON
SHIPPING
TOTAL
@if (count($cart_items) != 0) ₹{{ $subTotal }} @else ₹0 @endif
@if (auth()->check()) Proceed to checkout @else Guest checkout @endif
@else @endif