Local storage shopping cart. | Insert, update, remove products from the browser's local storage.

Digital Fox
Digital Fox
26.3 هزار بار بازدید - 2 سال پیش - In this video we are
In this video we are going to see basic shopping cart actions, like storing, updating, and removing products from the browser's local storage, with javascript and the localStorage object.

We are gonna work with higher order functions to make our life easier, such as:
- the filter() function.
- the find() function.
- and the map(), and reduce() functions.

If you are more a reader, you can check out the article on my website,
where you will find also the source code from this tutorial.
https://digitalfox-tutorials.com/tuto...

Also you can follow my facebook page:
Facebook: digitalfox.web.tutorials

If you find my content helpful, you can subscribe and
get notified every time i upload a new video. Thank you.

Hey guys i spotted an error.
In the updateQuantity function and inside the if statement please add the following line of code.
product.price = product.price * quantity;

This way the getTotal function will get the correct total price.
Sorry guys.

If you feel like saying thanks, you can buy me a coffee.
https://www.buymeacoffee.com/digitalfoxb
2 سال پیش در تاریخ 1400/12/29 منتشر شده است.
26,365 بـار بازدید شده
... بیشتر