JavaScript Shopping Cart Tutorial - Part 4/5

preview_player
Показать описание


★☆★ Best Website Hosting:

★☆★UDEMY COURSES:

★☆★Best laptops for Coding:

★☆★Best JavaScript Books

My Social Media:

Рекомендации по теме
Комментарии
Автор

For those who having the cartCost adding error (eg: 50 + 50 = 5050) try this :
{
name: 'junior-tiempo',
tag: 'shoe1',
price: 50, type the price as an int
inCart: 0
}

sithumlahiruu
Автор

Thank you for this tutorial, it helped me a lot with creating my cart by the use of methods that you showed ;) It took me more hours because I didn't want to copy and paste but create my own logic, so I'm glad you explained everything clearly.

nataliadziedzic
Автор

cartCost = parseInt(cartCost); isnt converting the string to a number and rather shows nan and the a number and when you add a item it just adds the number on instead of adding the 2 numbers together

gearsnob
Автор

For anyone who's had trouble adding the cost in the local storage (I'm not sure if this will help), make sure you check your spelling. It took me a while to find out that I misspelled "cartCost", where I accidentally used "cartcost" instead. Same with "inCart", I accidentally used "incart" a couple of times.

keithgriffin
Автор

the first time I click on the add to cart 'My cartCost is NaN' but will work after the first products been added to the cart, any solutions?

zaramccann
Автор

Hi ! I love the video series too ! Question : Hello,
I would like to know how to do so that when you click on the button, you display a message that says "Your item has been added to the cart", "Continue your purchases or go to th cart"?

philippedavid
Автор

Loving this class ....makes me refresh ..love the way you explain....sure I am gona follow you

santoshmohan
Автор

for me it shows the type of - my cart cost is --> object
it should be string as per the video

please help me...🔍

pranjalsapkale
Автор

fir those who are getting error in total cost just write.


console.log("my cartcost is ":product.price)

dheerajkoranga
Автор

Obrigada professor, conteudo incrivel!!

elisasantana
Автор

@ 5:49 When I click on 'add cart' for the first time the console displays:
My cartCosst is null
Object (instead of string)

kryptonwest
Автор

5:06 cartCos, it didn't show me the price instead it shows a NULL value. After I clicked on the button couple of times, it keep giving the price value that does not according to the product price in the javascript

yongkevin
Автор

Links to ABOUT page and CART page are not clickable
help ASAP please

antrikshgupta
Автор

I want to be able to remove a product from my cart page please I need a link that explains that

_tomzyofficial
Автор

I am totally loving this. You are awesome.

jithindavid
Автор

Your video made me subscribe. your teaching is very honest and clear. Thank you for this wonderful series. i really learned alot. May i suggest a tutorial. product variance options selector. with some complicated features. Such as choice of color changes the status of product sizes and quantity...etc.. nevertheless this series was great for me. thanks again

anmarm.
Автор

Please my images aren't showing any solution?

Emmanuel-pgvo
Автор

HEY ! How do you do for difference products in your "let products = [" ?
Because I use items on differents pages and when I inspect, it only recognized the first item,
can you help me please ?
Thank a lot to you

maximeredayug
Автор

Jus Awesome....I learnt loads and loads of can I ever thank you....:D

pinkym
Автор

hey guys im struggling with this part i cant get my incart items to add up
function setItems(product){
let
cartItems = JSON.parse(cartItems);

if(cartItems != null) {
if(cartItems[product.tag] == undefined){
cartItems = {
...cartItems,
[product.tag]: product
}
}
cartItems[product.tag].inCart += 1;
} else{
product.inCart= 1;
cartItems = {
[product.tag]: product

carlosreis