{{-- Note: This whole file is 'include'-ed in front/products/cart.blade.php (to allow the AJAX call when updating orders quantities in the Cart) --}}
Product | Price | Quantity | Subtotal | Action |
---|---|---|---|---|
@if ($getDiscountAttributePrice['discount'] > 0) {{-- If there's a discount on the price, show the price before (the original price) and after (the new price) the discount --}}
EGP{{ $getDiscountAttributePrice['final_price'] }}
EGP{{ $getDiscountAttributePrice['product_price'] }}
EGP{{ $getDiscountAttributePrice['final_price'] }}
|
+ {{-- The Plus sign: Increase items by 1 --}} {{-- .updateCartItem CSS class and the Custom HTML attributes data-cartid & data-qty are used to make the AJAX call in front/js/custom.js --}}
- {{-- The Minus sign: Decrease items by 1 --}} {{-- .updateCartItem CSS class and the Custom HTML attributes data-cartid & data-qty are used to make the AJAX call in front/js/custom.js --}}
|
EGP{{ $getDiscountAttributePrice['final_price'] * $item['quantity'] }} {{-- price of all products (after discount (if any)) (= price (after discoutn) * no. of products) --}}
|
{{-- --}}
{{-- .deleteCartItem CSS class and the Custom HTML attribute data-cartid is used to make the AJAX call in front/js/custom.js --}}
|
Cart Totals | |
---|---|
Sub Total{{-- Total Price before any Coupon discounts --}} |
EGP{{ $total_price }} |
Coupon Discount |
{{-- We create the 'couponAmount' CSS class to use it as a handle for AJAX inside $('#applyCoupon').submit(); function in front/js/custom.js --}} @if (\Illuminate\Support\Facades\Session::has('couponAmount')) {{-- We stored the 'couponAmount' in a Session Variable inside the applyCoupon() method in Front/ProductsController.php --}} EGP{{ \Illuminate\Support\Facades\Session::get('couponAmount') }} @else EGP0 @endif |
Grand Total{{-- Total Price after Coupon discounts (if any) --}} |
EGP{{ $total_price - \Illuminate\Support\Facades\Session::get('couponAmount') }} {{-- We create the 'grand_total' CSS class to use it as a handle for AJAX inside $('#applyCoupon').submit(); function in front/js/custom.js --}} {{-- We stored the 'couponAmount' a Session Variable inside the applyCoupon() method in Front/ProductsController.php --}} |