2) Update add_edit_delivery_address.blade.php file :-
We will update add_edit_delivery_address.blade.php file to add condition for action of the form. We will pass address id if user tries to edit delivery address. Also we will show delivery address existing details in delivery address form that user can update.
3) Update addEditDeliveryAddress function :-
Make sure to add condition at addEditDeliveryAddress function when id is not empty. We will get the posted data from delivery address form and will update that.
Now we will work on deletion of delivery address.
4) Create Route :-
Create GET route for deleting delivery address in web.php file like below :-
// Delete Delivery Address
5) Create deleteDeliveryAddress function :-
Now create deleteDeliveryAddress function at ProductsController in which we will delete delivery address with address id.
6) Update front_script.js file :-
Update front_script.js file to add jQuery for confirm of the delete address with class addressDelete.
Now we can able to delete delivery address as well.
Thanks for watching 🙂
Join this channel to get complete code: