{{-- Note: cart.blade.php is the page that opens when you ... --}} @extends('front.layout.layout') @section('content')

Cart

{{-- Displaying The Validation Errors: https://laravel.com/docs/9.x/validation#quick-displaying-the-validation-errors AND https://laravel.com/docs/9.x/blade#validation-errors --}} {{-- Determining If An Item Exists In The Session (using has() method): https://laravel.com/docs/9.x/session#determining-if-an-item-exists-in-the-session --}} {{-- Our Bootstrap success message in case of updating admin password is successful: --}} {{-- Displaying Success Message --}} @if (Session::has('success_message')) @endif {{-- Displaying Error Messages --}} @if (Session::has('error_message')) @endif {{-- Displaying Error Messages --}} @if ($errors->any()) @endif
{{-- We 'include'-ed this file to allow the AJAX call in front/js/custom.js when updating orders quantities in the Cart --}} @include('front.products.cart_items')
{{-- To solve the problem of Submiting the Coupon Code works only once, we moved the Coupon part from cart_items.blade.php to here in cart.blade.php --}} {{-- Explanation of the problem: http://publicvoidlife.blogspot.com/2014/03/on-on-or-event-delegation-explained.html --}}
Enter your coupon code if you have one.
{{-- Note: For Coupons, user must be logged in (authenticated) to be able to redeem them. Both 'admins' and 'vendors' can add Coupons. Coupons added by 'vendor' will be available for their products ONLY, but ones added by 'admins' will be available for ALL products. --}}
{{-- Created an id for this to use it as a handle in jQuery for submission via AJAX. Check front/js/custom.js --}} {{-- Only logged in (authenticated) users can redeem the coupon, so we make a condition, if the user is logged in (authenticated), we create that Custom HTML attribute 'user = 1' so that jQuery can use it to submit the form. Check front/js/custom.js --}} {{-- Note: We need to deactivate the 'action' HTML attribute (using action="javascript:void(0)" ) as we'r going to submit using an AJAX call. Check front/js/custom.js --}}
@endsection