***This Bootstrap 5 Version of the post is identical to the previous version other part the from the view display.blade.php which is formatted to use the flexbox-based grid approach which is available in Bootstrap 4 and 5*** In this series of posts we are going to build a simple shopping cart application. To do this [...]
Category: Shopping Cart Example
This section gives a step by step guide to building a simple shopping cart application in Laravel
Creating a Simple Shopping Cart Application - Step 2 - Adding a Navbar and Cart - *** Bootstrap 5 Version ***
*** This post is identical to the previous version apart from the code for the navbar which has been updated to reflect the changes to the way BS5 handles navbars *** In this post we will extend the functionality of the shop window with a navbar showing the number of items in the cart and [...]
Creating a Simple Shopping Cart Application - Step 3 - Loading the number of Cart Items from the session and clearing the cart
The cart is now working well and the cart contents are stored in a session so even if the user leaves the page the information will not be lost. When we created the page in step 1 we included a div called 'cart' which would indicate the number of items in the cart this was [...]
Creating a Simple Shopping Cart Application - Step 4 - Adding a Checkout Order Form
In this step we need to review the contents of the cart before supplying additional information and placing the order. The following action can be added to app/Http/controllers/scordersController.php. It will pull each item from the cart into an array called $lineItems. The cart only contains a productid and quantity for each line item of the [...]
Creating a Simple Shopping Cart Application - Step 5 - Adding a Search Filter
*** The technique used in the following Post is only available if you are using the Bootstrap 5 version of the Shopping Cart -- see Posts at the beginning of the Shopping Cart Section *** Now that we have a d-flex grid (which is based on a css flexgrid) it is relatively straightforward to introduce [...]