Table of Contents
- 1) Run below command to install this package
- 2) Put 'add to cart ' form inside view files of product listing after 'Cost' i.e
- 3) Also create cart.blade.php views file under resources/views/products and put below code
- 4) Now create cart.blade.php inside resources/views/includes and put below
- 5) Put below on routes/web.php file
- 6) Create a Controller ShopController.php then functions add_to_cart ,cart .
- Setup Checkout Page
There are lots of ecommerce/shopping cart solutions available in the market .
Some are available from WordPress' Woocommerce, Magento, Open Cart, Prestashop.
They are ready made CMS or plugins. If we consider deep customisation as per client custom requirement, It could be a more tedious task to accomplish this.
So, lots of companies choose PHP framework. The no.1 PHP framework in current Web Development in Laravel.
Laravel provides robust application development with a fully secured way .
Using PHP Laravel, we can easily customise anything . Company also chose Laravel for ecommerce because of its feature customizable.
It is also better performance if we compare with any CMS .
Today in this tutorial , i will cover in details of starting an ecommerce Laravel project/application from scratch.
All Packages found on https://packagist.org (for core php, laravel ,symfony ,zend framework etc)
Only Laravel packages found on https://packalyst.com/
For our tutorial we will be using this shopping cart package
1) Run below command to install this package
- Open config/app.php and add this line to your Service Providers Array
- then add this line to your Aliases in same file
2) Put 'add to cart ' form inside view files of product listing after 'Cost' i.e
resources/views/includes/product_loop.blade.php (for home page latest product) resources/views/products/product_details.blade.php
3) Also create cart.blade.php views file under resources/views/products and put below code
@endsection
4) Now create cart.blade.php inside resources/views/includes and put below
Note : you should have jquery file inside section in layout/master.blade.php
ex:
5) Put below on routes/web.php file
6) Create a Controller ShopController.php then functions add_to_cart ,cart .
Now open the website and click on the 'add to cart' button to test .
If you are looking to hire PHP Laravel Developer, freelancer in Delhi, Noida, India. Visit here . Setup Checkout Page
On this tutorial series of Laravel ecommerce from scratch, we have already setup of basic ecommerce using cart package . Now here we will create checkout page .1) Put below button in cart.blade.php found under resources\views\products
2) Put below in route file routes/web.php
3) Create a 'checkout' function in ShopController.php as shown below
also call below use Auth;
4) Create view file checkout.blade.php inside resources/views/products/
and put below code
In this way we setup or checkout page . We will create paypal payment gateway on next tutorial of this series.
You can also visit here Laravel website developer Delhi.