Every once in a while you search through KZbin and find a channel that is new, but you know it will clearly get huge one day based on the content and quality. Today I found that channel. Subbed 💪
@DigitalFox-tutorials2 жыл бұрын
Thank you
@oluwafemiolukoya93522 жыл бұрын
the most straightforward local storage tutorial I've watched on here well done!
@DigitalFox-tutorials2 жыл бұрын
Thank you
@adotornado-e4o2 жыл бұрын
Exactly what I needed, thank you.
@FranciscoUberto2 жыл бұрын
amazing video, very well done. Super clear and effective. thank you so much
@DigitalFox-tutorials2 жыл бұрын
Thank you, glad you liked it!
@nuralomislam83642 жыл бұрын
superb presentation bro.. keep it up
@DigitalFox-tutorials2 жыл бұрын
Thank you so much 🙂
@naijacanact81532 жыл бұрын
Impressive presentation
@DigitalFox-tutorials2 жыл бұрын
Thank you!
@krisNemeth552 жыл бұрын
great tutorial dude! One question though: why did we added the function to increase quantity if then at the end it doesn't count towards the total price? I feel it won't be so far off to be able to update the price with the quantity in mind?
Nice work. Yes i spotted the error to so i added in the description a line of code to update the price when i update the quantity.
@krisNemeth552 жыл бұрын
@@DigitalFox-tutorials I never found that, managed to sort it without. Thanks for the help! Now time to wire everything up to buttons and selects :')
@DigitalFox-tutorials2 жыл бұрын
Happy coding
@bhanukadasanayaka34572 жыл бұрын
you earned one sub👌🏻
@DigitalFox-tutorials2 жыл бұрын
Thank you
@PokemonGo-re7ue Жыл бұрын
What would the code look like if you wanted more items of the same type in the cart?
@DigitalFox-tutorials Жыл бұрын
Hey, we wouldn't check if the product already exist in the cart. So we don't need the else clause in the "addItemToCart" function. else{ let res = cart.find(item => item.id == productId); if(res === undefined){ cart.push(product); } }
@PokemonGo-re7ue Жыл бұрын
@@DigitalFox-tutorials Thank you so much for the reply
@georgejuarez660 Жыл бұрын
Nice video but i just have one question: how can i output json file results (from cart) into html page with local storage?
@DigitalFox-tutorials Жыл бұрын
Hey, check this short post out . digitalfox-tutorials.com/tutorial.php?title=How-browser%27s-local-storage-works I hope it helps.
@andyandy19502 жыл бұрын
the only question arises is what about security , if i change price of an item in html for example then its gonna take wrong data
@DigitalFox-tutorials2 жыл бұрын
Yes you are right, that's why we never use data from the local storage or fetch them from the html code in the checkout page. We pull them from the database or where ever we store them in the server. Using the local storage gives the user a fast user experience. As for the security we always use a server side language. I wanted to show you the logic behind storing a shopping cart in the browser.
@brok_than29012 жыл бұрын
hello Digital Fox am thanos
@DigitalFox-tutorials2 жыл бұрын
Hi Thanos
@brok_than29012 жыл бұрын
@@DigitalFox-tutorials hi
@MohamedTarek-kl5hf Жыл бұрын
clear as fuck
@billi59202 жыл бұрын
wtf is a " promise " ?
@DigitalFox-tutorials2 жыл бұрын
Check this out developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise developer.mozilla.org/en-US/docs/Web/API/Fetch_API