Summary

{{ count($carts) }} Items
@php $subtotal = 0; $tax = 0; $shipping = 0; $product_shipping_cost = 0; @endphp @foreach ($carts as $key => $cartItem) @php $product = \App\Models\Product::find($cartItem['product_id']); $subtotal += $cartItem['price']-$cartItem['discount']; $tax += $cartItem['tax'] * $cartItem['quantity']; $product_shipping_cost = $cartItem['shipping_cost']; $shipping += $product_shipping_cost; $total=$subtotal+$shipping+$tax; $product_name_with_choice = $product->name; if ($cartItem['variant'] != null) { $product_name_with_choice = $product->name.' - '.$cartItem['variant']; } @endphp @endforeach
Product Total
{{ $product_name_with_choice }} × {{ $cartItem['quantity'] }} {{ $cartItem['price']-$cartItem['discount'] }}
Subtotal {{ $subtotal }}
Tax {{ $tax }}
Total Shipping {{ $shipping }}
Total {{ $total }}