Laravel Multi Vendor E-commerce

Опубликовано: 27 Декабрь 2024
на канале: Stack Developers
603
10

►Laravel Multi Vendor E-commerce from the beginning:-    • Laravel Multi Vendor Tutorial  

In Part-165, we will start working on advance shipping method that most of the e-commerce website integrates.

In advance way, we will add shipping of all countries weight wise in which we will add weight for all products and shipping will be calculated according to the weight and the country.

First of all, make sure we able to add weight for every product only then correct shipping charges we can calculate for the order.

Now, we will update shipping_charges table with weight columns and drop shipping_charges column from the table with Migration commands.

1) Drop rate column :-
Run below Migration command to drop rate column that is common for all weights from the shipping_charges table.
php artisan make:migration drop_column_from_shipping_charges_table

Update newly created migration file to drop rate column from shipping_charges table.

Finally run "php artisan migrate" command to drop the column.

2) Add Columns to shipping_charges table :-
We will add separate weight columns instead of one in which we will add shipping charges that will come according to weight. Like for the product weight between 0 to 500 gram, we can add INR 100 shipping charges and so on

We will add below columns for below weights :-
For 0 to 500 gram weight - 0_500g
For 501 to 1000 gram weight - 501_1000g
For 1001 to 2000 gram weight - 1001_2000g
For 2001 to 5000 gram weight - 2001g_5000g
For 5000 gram above weight :- above_5000g

Run below Migration command to add weight columns in shipping_charges table like below :-
php artisan make:migration add_columns_to_shipping_charges_table

Update newly created migration file to add weight columns specified earlier.

Finally run "php artisan migrate" command to add the columns.

3) Update shipping_charges.blade.php file :-
Update shipping charges page in admin panel to remove column shipping charges column and add weight wise shipping charges columns.

4) Update edit_shipping_charges.blade.php file :-
Update edit shipping form to add new weight wise shipping charges columns and remove common weight column.

5) Update editShippingCharges function :-
Now we will update editShippingCharges function at ShippingController to update weight wise shipping charges columns instead of common one.

Now we can update shipping charges weight wise for any country from admin panel.

In next video, we will work on front end to calculate shipping charges weight wise and apply it to grand total.

Thanks for watching :)

►Laravel 9 Tutorial Playlist (Create Multi-Vendor E-commerce Website) -    • Laravel Multi Vendor Tutorial  

►Click here to subscribe for Laravel & other updates -    / stackdevelopers  

Popular Stack Developers Series that can help you:-

►React JS Tutorial for Beginners with Laravel 9 -    • 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

#laravel9 #laravel9tutorial #laravel