►Laravel 11 Tutorial (with MongoDB): • Laravel 11 Tutorial (with MongoDB)
This is Part 109 of the Laravel 11 Tutorial, in which we are building the e-commerce website with Laravel as the front end and MongoDB as the back end. We will continue working on the order placement process.
In this part, we will place order and insert order details in orders and orders_products tables.
Update checkout function :-
We will update checkout function step by step for inserting the order details in orders tables.
1) First of all, we will add a check to ensure the user selects one of the delivery addresses as default.
2) Add condition to assign COD in payment_method variable if payment_gateway is COD otherwise Prepaid in all other cases like Paypal or any others in future.
3) Finally insert delivery address, coupon, shipping details, grand total, payment method etc. in orders table.
We will first get the total price to calculate the grand total after deducting coupon amount. Later on we will also calculate shipping charges and will add to grand total.
4) Insert all user cart items in the orders_products table in foreach loop.
5) Include below header statements at the top of ProductController:-
use App\Models\Order;
use App\Models\OrdersProduct;
use DB;
6) Add getAttributeSKU function in ProductsAttribute model:-
Now check in video; orders details get inserted into orders and orders_products tables.
►Click here to subscribe for Laravel & other updates - / stackdevelopers
Popular Stack Developers Series that can help you:-
►Laravel 11 PostgreSQL Tutorial: • Laravel PostgreSQL Tutorial
►Laravel 10 Tutorial: • Laravel 10 Tutorial: Make Admin Panel...
►Laravel Multi-Vendor E-commerce Series - • Laravel Multi Vendor Tutorial
►React JS Tutorial for Beginners with Laravel - • React JS Tutorial with Laravel for Be...
►Laravel Tutorial for Beginners - • Laravel Tutorial for Beginners | Adva...
►GIT Tutorial for Beginners - • Git Tutorial for Beginners | Create y...
►Laravel API Tutorial - • Laravel API Tutorial | Create API fro...
►Laravel Interview Questions - • Laravel Interview Questions & Answers...
►jQuery Tutorial - • jQuery Tutorial
►Laravel Basic E-commerce Series - • Make Admin Panel / E-commerce Website...
►Laravel Dating Series - • Make Dating / Social Networking Websi...
►Join this channel to get the complete source code of all series:
/ @stackdevelopers
Follow Stack Developers on Social Media to get updates and resolve your queries
►Like Facebook Page to get updates - / stackdevelopers2
►Join Facebook Group to resolve your queries - / stackdevelopers
►Follow on Instagram - / stackdevelopers2
►Follow on GitHub - https://github.com/stackdevelopers
#laravel11 #mongodb #mongodbtutorial
Watch video Laravel 11 with MongoDB online without registration, duration hours minute second in high quality. This video was added by user Stack Developers 07 September 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 48 once and liked it 1 people.