#119

Опубликовано: 01 Январь 1970
на канале: Stack Developers
1,787
20

In Part-119 of E-com series, we will start working on pincodes availability functionality for the products. We will display the "Check Pincode" field at detail page where user can enter his pincode to check whether his location is available for delivery or not.

1) Search Pincodes data :-
First search Google for indian pincodes in excel format or better if we will get MySql database otherwise we will import. You can also search pincodes for your country and I am sure you will also get some data.

2) Create pincodes table :-
Now create pincodes table with below columns :-
id (int, AI, primary)
pincode (varchar,20)
city (varchar,255)
state (varchar, 255)
created_at (datetime)
updated_at (timestamp)

3) Import CSV file :-

We will modify excel file with 6 columns of pincodes table and convert into CSV before importing them into pincodes table as shown in video.

Now our pincodes table is ready with pincodes that are available for shipping of the order. We will not allow the user to place the order with some other pincode.

4) Update detail.blade.php file :-
Now we will update detail.blade.php file with "Enter Delivery Pincode" field where customer can enter his pincode to check if the product is available to be delivered to his place or not.

5) Update main.js file :-
We will now create checkPincode jQuery function in main.js file where we will get the pincode and pass it to checkPincode Laravel function at ProductsController to verify and return with message to intimate the user whether the pincode is available or not. But first we will add condition to check if pincode entered by user or not. If not entered, then we will alert the user to enter and abort the process.

In next video, we will add ajax script to jquery function to check whether the pincode is available or not. And, will play with it by adding lot of stuff.

Thanks for watching :)


Смотрите видео #119 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Stack Developers 01 Январь 1970, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,787 раз и оно понравилось 20 людям.