CaptionsMaker
.com
#152 Make E-com in Laravel 8 | Shipping Charges - Simple (I) | Country wise Shipping | View Charges
Edit Subtitles
Download Subtitles
SRT
TXT
Title:
Description:
In Part-152 of Advance E-commerce series, we will start working on shipping charges that we will add on total amount of the order. We will give option in admin to add shipping for all the countries. There are 2 methods of adding shipping charges in E-commerce website. One is the simple way of adding shipping charges for all the countries and one is the advance way of adding shipping charges for all the countries weightwise in which we will add weight for all the products and shipping will be added according to the weight and country both. 1) Shipping Charges - Simple (I) | Country-wise Shipping 2) Shipping Charges - Advance (II) | Country / Product Weight-wise Shipping First we are going to work on simple process of adding shipping charges for all the countries from admin panel. In this video, we will create shipping_charges table with migration and will import list of countries. We will also create ShippingCharge model. 1) Create shipping_charges table :- First of all, we will create shipping_charges table with migration. Create migration file with name create_shipping_charges_table for creating shipping_charges table with below columns :- id, country, shipping_charges, status, created_at and updated_at So, we will run below artisan command to create migration file for shipping_charges :- php artisan make:migration create_shipping_charges_table Open create_shipping_charges_table migration file and add all required columns mentioned earlier. Now, we will run below artisan command to create shipping_charges table with required columns :- php artisan migrate Now shipping_charges table has been created with all the required columns. 2) Import Countries :- Now we will import countries from the countries table from the steps shown in the video. 3) Create ShippingCharge model :- Create ShippingCharge model by running below artisan command :- php artisan make:model ShippingCharge 4) Create ShippingController Controller :- Create ShippingController under Admin by running below artisan command :- php artisan make:controller Admin/ShippingController 5) Update admin_sidebar.blade.php :- Add link for the shipping charges at left sidebar of the admin panel. 6) Create Route :- Now create GET route for view shipping charges in web.php file like below :- // View Shipping Charges Route::get('view-shipping-charges','ShippingController@viewShippingCharges'); 7) Create viewShippingCharges function :- Now create viewShippingCharges function at ShippingController in which we will get shipping charges for all the countries and return to view_shipping_charges.blade.php file that we will create in next step. 8) Include Header Statement :- Add below statement at the top of your ShippingController file to include ShippingCharges model :- use App\ShippingCharge; 9) Create view_shipping_charges.blade.php file :- Now we will create view_shipping_charges.blade.php file in which we will add foreach loop to display shipping charges for all the countries. In next video, we will work on active/in-active status and update functionality for the shipping charges. Join this channel to get complete code : https://www.youtube.com/channel/UCExO2i-tLU1NyVZD6zOJQlw/join
YouTube url:
https://www.youtube.com/watch?v=7UxBfw0PXI4
Created:
1. 5. 2021 17:03:15