Create a Shopping Cart With Vanilla JavaScript | ES6

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2024

ความคิดเห็น • 150

  • @CodeExplained
    @CodeExplained  หลายเดือนก่อน

    🚨 Big Announcement! 🚨
    Hey everyone! I've made a big decision for this channel-I've turned off ads on all my videos! That's right, you can now enjoy all my content ad-free! This means I'm earning $0 from ad revenue, but I believe this is the right move to make your viewing experience better.
    If you find my content valuable and want to support my work, there are several ways you can help:
    Like & Share: Simply liking the video and sharing it with friends helps a lot!
    Subscribe & Hit the Bell: Stay updated and never miss a new video.
    TH-cam Thanks: Use the "Thanks" button below to send a one-time donation.
    Join the Channel Community: Get exclusive perks and behind-the-scenes content.
    Buy Me a Coffee: buymeacoffee.com/CodeExplained
    PayPal Donation: www.paypal.com/paypalme/CodeExplained
    Every little bit counts and goes directly to creating more high-quality content for you all. Thank you so much for your continued support!
    Let’s keep growing and learning together! 🌟

  • @rfryanfavour4369
    @rfryanfavour4369 2 ปีที่แล้ว +16

    Lol tbh firstly you just did a lot for me as a freelancer I appreciate that big time... and you used all easy syntaxes in such a unique way... you sir deserve an award I appreciate you... thank you

  • @solomonjackson7984
    @solomonjackson7984 ปีที่แล้ว +4

    Best vanilla JavaScript tutorial ever,
    With a good and clear English, thank you sir.

    • @ifeomablessing9578
      @ifeomablessing9578 ปีที่แล้ว

      💯 accurate. However I need help. When I host my project on git, the images in the array are not displaying. I need help please

  • @maxmaksum4673
    @maxmaksum4673 2 ปีที่แล้ว +2

    Men you are so clear, simple, logical in explaining this stuff. Thank you

  • @biancas9110
    @biancas9110 25 วันที่ผ่านมา

    Thank you so much for such a detailed and helpful tutorial!! Keep up the good work

    • @CodeExplained
      @CodeExplained  24 วันที่ผ่านมา

      Thank you! Will do!

  • @ummasiyah3238
    @ummasiyah3238 2 ปีที่แล้ว +3

    Thank you so much for the clear explanation. This is by far the best shopping cart tutorial I have come across.

  • @Sky-yy
    @Sky-yy 3 ปีที่แล้ว +4

    Thanks for explaining so deeply. You're doing just outstanding job, by just not typing and telling what to do just like other tutors do, even Brad traversy does that which is not good, you're explaining the line by line code and implement.

    • @CodeExplained
      @CodeExplained  3 ปีที่แล้ว +3

      Yeah I always try my best to explain the logic behind ... thanks a lot for your comment.

    • @Sky-yy
      @Sky-yy 3 ปีที่แล้ว

      @@CodeExplained this needs to be recognized coz even the paid udemy courses does that thing of coding and telling what they are doing. It should be like "what, how, why" should be answered and thats how a beginner's mind would understand how to approach logically.

    • @CodeExplained
      @CodeExplained  3 ปีที่แล้ว +3

      Yeah you're right, beginners need to understand everything so they can write their own code by themselves, or they will just copy others code all the time and that will take so much time for them to learn things they can learn in a very short time ... well thanks again for your comment

    • @Sky-yy
      @Sky-yy 3 ปีที่แล้ว

      @@CodeExplained I have landed my first job as software engineer it's been 2 months and I struggled alot. Coz I wasn't able to write code on my known coz I followed tutorials which used to teach like"typing code and tell what they were doing even in paid " no hows, where, why.
      I hope you create more such content, it would really add real value to people's lives.
      MERN project series would be awesome if you start with that.

  • @bensonbenson4149
    @bensonbenson4149 8 หลายเดือนก่อน

    i had to pause the video at minute 23 to drop this comment because just few minutes in and i am understanding so many concepts i didnt understand before. great job brother

  • @alinabianca3934
    @alinabianca3934 8 หลายเดือนก่อน

    Thank you so much for this!!An extraordinary teacher! Easy code and explained very well

  • @CAFernandezB
    @CAFernandezB 2 ปีที่แล้ว +6

    Please do More vanilla projects!! You're amazing Bro! Saludos desde Venezuela, tus vídeos son los mejores.. soy un fiel seguidor, extrañaba tus vídeos, espero ver muy buen material de proyectos de la vida real, que nos abren la mente, nuevamente gracias.. tu contenido, y la forma en la que explicas, es de lo mejor que he visto.

  • @elieli2570
    @elieli2570 2 ปีที่แล้ว +7

    Extremely useful tutorial as usual, many thanks for bringing this to us!

  • @rfryanfavour4369
    @rfryanfavour4369 2 ปีที่แล้ว

    THIS is the best tutorial I've ever watched in my life

  • @stevenfranz5462
    @stevenfranz5462 ปีที่แล้ว +1

    Thank you so much for this tutorial!
    This explanation is the best on TH-cam.

  • @bogopurvi
    @bogopurvi 2 ปีที่แล้ว +1

    This is the very best video I found that truly helped me. It was easy to follow and straight-to-the-point. Keep up the good work! Thank you!

  • @kambatukebele
    @kambatukebele 10 หลายเดือนก่อน

    Well done and well explained. I liked how you broke down every steps and took your time explaining everything.

  • @teyuu
    @teyuu 2 ปีที่แล้ว +1

    Thank you so much for this video. It really helped to do some homework I had and to understand very easy some concepts of JavaScript. Great teacher, congrats!

  • @SandeshMotoVlogs
    @SandeshMotoVlogs 3 ปีที่แล้ว +1

    I have only 1 word for u :
    GOAT 🐐 ( Greatest Of All Time)

  • @negin3408
    @negin3408 ปีที่แล้ว +1

    This is the best video i found that truly helped me 🌟thank you

  • @revayuap972
    @revayuap972 2 ปีที่แล้ว

    This guy is a legend very straight forward tnx so much man

  • @vt9988
    @vt9988 2 ปีที่แล้ว +1

    this tutorial is the best I could find on youtube :) Please contiunue doing amazing tutorials :D

    • @CodeExplained
      @CodeExplained  2 ปีที่แล้ว

      Oh thanks a lot buddy, happy to hear that 😊

  • @marymaundu1702
    @marymaundu1702 9 หลายเดือนก่อน

    This is really so well explained. I learnt a lot, Thank you.

  • @EnumahPearl
    @EnumahPearl 6 หลายเดือนก่อน

    A great teacher❤

  • @lokeshkhati8413
    @lokeshkhati8413 3 ปีที่แล้ว +2

    I've been eagerly waiting for your video❤️

  • @T_Midnight_Sun
    @T_Midnight_Sun 15 วันที่ผ่านมา

    Guyyyy you’re the best ❤

  • @ambareen2368
    @ambareen2368 3 ปีที่แล้ว +8

    Please do more vanilla JS projects! 🙏 these are soooo helpful

  • @AjayKumar-id7mb
    @AjayKumar-id7mb 2 ปีที่แล้ว +1

    Thanks Bro you are doing a great work
    Your way of teaching is really simple
    Loved that

  • @gopalakrishnachinta3769
    @gopalakrishnachinta3769 2 ปีที่แล้ว +1

    Thank you so much sir for this valuable tutorial and 'easy to understand' explanation.

  • @dindindongi
    @dindindongi 2 ปีที่แล้ว +1

    I am beyond thankful for your detailed explanation, it helped me alot to understand the basic concept and implementation🙏

  • @frontendwithsalimi
    @frontendwithsalimi 2 ปีที่แล้ว +1

    Thank you for this beautiful tutorial.
    Your explanation is really easy to understand and I learned a lot

  • @dansmar_2414
    @dansmar_2414 2 ปีที่แล้ว

    This is the best shopping cart tutorial!!! Thank you so much

  • @lastley7886
    @lastley7886 ปีที่แล้ว

    You Rock! It's the best guide I've ever seen. Thank you so much.

  • @irwankaryantotandek6058
    @irwankaryantotandek6058 2 ปีที่แล้ว +1

    Love ur channel. Please do more vanilla javascript projects with fetch and more.. Subscribed!

  • @amanpratap5547
    @amanpratap5547 ปีที่แล้ว

    Extremly Extremly Extremly..........................useful.
    Thanks for the content.

  • @shahhussain5563
    @shahhussain5563 ปีที่แล้ว

    very clear and crisp explanation. Thanks a millions ❤

  • @CodeWithOgochukwu
    @CodeWithOgochukwu 2 หลายเดือนก่อน

    Wow! Thanks for this

  • @ashrafulmomenshuvo5344
    @ashrafulmomenshuvo5344 ปีที่แล้ว

    Awesome !!! so easy method to create Shopping Cart ...!!!

  • @dtawantawng5131
    @dtawantawng5131 ปีที่แล้ว

    This is fantastic! Thank you for the great content! 👏

  • @andrisalazar7565
    @andrisalazar7565 2 ปีที่แล้ว

    THanks a Lot for all this information!!!
    very well explained

  • @mmonir2061
    @mmonir2061 ปีที่แล้ว

    Such a wonderful video! nicely explained. Really appreciate. Waiting for new videos.

  • @howtodo9412
    @howtodo9412 2 ปีที่แล้ว

    That's Great! I have been Helpful from this video, I am beginner in javascript.

  • @mackinlay27
    @mackinlay27 ปีที่แล้ว

    What a great tutorial! thank you.

  • @someChicoRy
    @someChicoRy ปีที่แล้ว

    thank you for your hard work. it was very informative and useful🙂

  • @GabrielSilva-yk6kk
    @GabrielSilva-yk6kk 2 ปีที่แล้ว

    thanks for sharing your knowledge

  • @renesalvacion2452
    @renesalvacion2452 ปีที่แล้ว

    Its working if you have one array of object only, but if you create multiple array of object the quantity in add to cart will have a behaviour of twice amount of quantities on every button of quantity that you click in add to cart in every object inside the array of object

  • @thientinhlamhuynh3004
    @thientinhlamhuynh3004 2 ปีที่แล้ว

    Wow! Good job bro, keep going.

  • @jahjahtruth
    @jahjahtruth 2 ปีที่แล้ว +1

    Nice tutorial! added an alert for if the user tries to add quantity that is not available instock. Now just wondering how to dynamically change the instock value after a purchase.

    • @GuitarHope
      @GuitarHope ปีที่แล้ว

      I haven't tried it yet but I think I'd create an update function for the instock value (based on the product id) which would be called after every purchase.

  • @charlesohlson4316
    @charlesohlson4316 ปีที่แล้ว

    I have a project coming up to get a online degree while most of everyone knows abouts...... this is huge help. Yup I'm aboard send all info brother.

  • @universalworthy2169
    @universalworthy2169 2 ปีที่แล้ว +1

    Wonderful live saver tutorial. Please do more vanilla js projects, like pagination, dictionary...

    • @CodeExplained
      @CodeExplained  2 ปีที่แล้ว

      Happy to hear it was helpful, yes I will.

  • @_myenglishbro
    @_myenglishbro ปีที่แล้ว

    Amazing tutorial

  • @march9698
    @march9698 3 ปีที่แล้ว +3

    Could you possibly make another video on this project, but this time on how to make it responsive? It seems like an awesome project on the JS side, but there is a lot of overflowing when you shrink the screen.

    • @CodeExplained
      @CodeExplained  3 ปีที่แล้ว +1

      Yeah I know, I didn't want to waste time on making it responsive, sorry.

    • @march9698
      @march9698 3 ปีที่แล้ว

      @@CodeExplained No need to be sorry, you did an amazing job.

  • @plaguegames3556
    @plaguegames3556 2 ปีที่แล้ว

    Great explanation

  • @vijayd5551
    @vijayd5551 2 ปีที่แล้ว

    lots of thanks... please share the next part for checkout cart.

    • @CodeExplained
      @CodeExplained  2 ปีที่แล้ว

      Next part?
      What do you want for next part?

  • @mateenmahi
    @mateenmahi ปีที่แล้ว

    That's awesome

  • @fishmarkholmes1834
    @fishmarkholmes1834 3 ปีที่แล้ว

    I love your video so much , thank you 🙏🏻

    • @CodeExplained
      @CodeExplained  3 ปีที่แล้ว

      Happy to hear that, thanks ❤️

  • @sahedsumon8511
    @sahedsumon8511 3 ปีที่แล้ว

    It's a really great explanation.

  • @rabiekhalifa1103
    @rabiekhalifa1103 ปีที่แล้ว

    Thank you a lot 💖

  • @Omid.Pishkar
    @Omid.Pishkar 2 ปีที่แล้ว

    Very nice... i like this video

  • @codewithharris
    @codewithharris ปีที่แล้ว

    Please when are you gonna add filter cards JavaScript tutorial. I have search every where but doesn't implement it without error

  • @feliciatimmy9467
    @feliciatimmy9467 3 ปีที่แล้ว

    you're a life saver bro

    • @CodeExplained
      @CodeExplained  3 ปีที่แล้ว

      Happy to hear that, thanks ❤️

  • @azureliseraleighchocolatec6832
    @azureliseraleighchocolatec6832 2 ปีที่แล้ว

    Great.

  • @olidhossen9785
    @olidhossen9785 2 ปีที่แล้ว

    Nice

  • @charlesmwaniki1868
    @charlesmwaniki1868 2 ปีที่แล้ว

    perfect....thanks man

  • @ifeomablessing9578
    @ifeomablessing9578 ปีที่แล้ว

    Awesome. However I need help. When I host my project on github, the images in the array are not displaying. I need help please

  • @essenc3189
    @essenc3189 ปีที่แล้ว

    veryy good tutorial , 10x

  • @omiosomoy4706
    @omiosomoy4706 2 ปีที่แล้ว

    this is a life saver

  • @tahirzaman9441
    @tahirzaman9441 2 ปีที่แล้ว

    Waiting for your new videos...➡️➡️➡️➡️➡️ Js projects

  • @ДмитрийТравин-ц4д
    @ДмитрийТравин-ц4д 3 ปีที่แล้ว

    I wish you 1m subscribers!

  • @ОнопрієнкоСергій-й3ю
    @ОнопрієнкоСергій-й3ю ปีที่แล้ว

    thanks so much

  • @yogapassion
    @yogapassion 2 ปีที่แล้ว

    I have been waiting more videos from you for a long time . Do you alright ?

  • @codingislife6387
    @codingislife6387 2 ปีที่แล้ว

    Nice Sir. Please Make More Project ... Please Please

  • @eliasgrinwisplaatstultjes7857
    @eliasgrinwisplaatstultjes7857 2 ปีที่แล้ว +1

    Is there a way to use the shopping cart on another html page? so that the shopping cart is not on the right? Because when i try that my cart doesn't render

  • @sarvij9870
    @sarvij9870 2 ปีที่แล้ว

    Hi, best shopping cart tutorial, ty Sir.
    I have a question: min 38:50, instead of showing the price, i got NaN. Any solutions?

  • @krzysiekwarchal
    @krzysiekwarchal 2 ปีที่แล้ว

    Great Job. Is there a way to send the shopping bag to email when clicking proceed to checkout?

  • @zalisco1
    @zalisco1 2 ปีที่แล้ว

    THANK YOU BROTHER

  • @darkNovaskar
    @darkNovaskar ปีที่แล้ว

    If I download it as a zip file then complete it and push it to my git hub will it show you as the contributor?

  • @codingislife6387
    @codingislife6387 2 ปีที่แล้ว

    Thank Sir.

  • @sdfsdfsdffdsfsdfsd123
    @sdfsdfsdffdsfsdfsd123 2 ปีที่แล้ว

    thank you !!!!

  • @lovemanga_forever
    @lovemanga_forever 2 ปีที่แล้ว

    I see your video of react and know how to use useContext, useEffect in real life. Could you make a project in React that use other hooks like useReducer useCallback useMemo so I can break down and analysis how and when to use them. Thank you 👍

  • @nataliabogach6580
    @nataliabogach6580 2 ปีที่แล้ว

    How can you add product options like size and color ?

  • @aboodibajaman9975
    @aboodibajaman9975 2 ปีที่แล้ว

    hi but how can i add a form with the cart like i want the user to enter his name, number etc with the cart and that to be submitted with products in the cart. i want to get the data of the cart and the form

  • @alexanderson1193
    @alexanderson1193 2 ปีที่แล้ว

    if I want to make a separate single product page what do I need to alter?

  • @fatimakayy
    @fatimakayy ปีที่แล้ว

    Very helpful tutorial. Could you please tell me what to do if instead of stopping the user from reducing quantity below zero, I can simply remove that product from the cart when they get to zero?

    • @CodeExplained
      @CodeExplained  ปีที่แล้ว +1

      We have created a function "changeNumberOfUnits" we use the map method to change the array cart items number of units.
      I think you'll need to use a forEach method, and play with the "if statement" so when the numberOfUnits === 1 and the user clicks on "minus" => call the function "removeItemFromCart"
      If you still need help just ask.

    • @fatimakayy
      @fatimakayy ปีที่แล้ว

      @@CodeExplained thank you! I figured it out

  • @Kevin-uf7yt
    @Kevin-uf7yt 2 ปีที่แล้ว

    if i use json to store my data, what is the equivalent code of the function addToCart in 16:39 for it?

  • @aza7866
    @aza7866 ปีที่แล้ว

    Nice video, but onclick event is a bit outdated, I tried to use eventlistener as an alternative somehow but didnt manage it (Im only in my first year computer science) :(

  • @shubhamjangid5936
    @shubhamjangid5936 2 ปีที่แล้ว

    how to render the cart items on a diffrent cart page ?
    IM STUCK HERE :(

    • @CodeExplained
      @CodeExplained  2 ปีที่แล้ว

      I think the cart items are saved to the local storage, so when going to another page, all you need to do, is to get items from the local storage, and render them to your new page.

  • @callumspellium1516
    @callumspellium1516 3 ปีที่แล้ว +1

    weres the chocolate and banna javscript?

    • @CodeExplained
      @CodeExplained  3 ปีที่แล้ว +1

      Coming Soon!
      Vanilla JS means Plain JS no framework.

  • @mohanadgallab
    @mohanadgallab 8 หลายเดือนก่อน

    thank you alot for this ,,

  • @tigerwalkcommunications7426
    @tigerwalkcommunications7426 2 ปีที่แล้ว

    Please on your next video make a checkout page😌

  • @Mindinmatrix
    @Mindinmatrix 2 ปีที่แล้ว

    How would keep the number of items to be display on other pages. Im asking that because i want the number of items in cart to be in the nav bar on all my pages. The user can then click on the cart to go to cart. let me know, thank you :D love your videos.

    • @CodeExplained
      @CodeExplained  2 ปีที่แล้ว

      Save the cart to the user's browser's local storage.

    • @Mindinmatrix
      @Mindinmatrix 2 ปีที่แล้ว

      @@CodeExplained Thank you! I had already figured it out. I also manage to make orders and render orders to the user's profile page and much more! Your video propelled me in the right direction! Thanks again!

  • @mybMee
    @mybMee 3 ปีที่แล้ว

    thanks 😊👍

  • @expukpuk
    @expukpuk 3 ปีที่แล้ว +1

    Where is the link for your template in github?

    • @CodeExplained
      @CodeExplained  3 ปีที่แล้ว

      github.com/CodeExplainedRepo/shopping-cart-javascript

  • @andrewsokolovsky9127
    @andrewsokolovsky9127 2 ปีที่แล้ว

    I do not understand why this forEach of renderCartItems adding same element second time. Loop is going to another element of an array, so why previous is here too? Could you explain it more to me? ps.thanks a lot for this video man!:)

  • @MamamimPlodtook
    @MamamimPlodtook 2 ปีที่แล้ว

    Hi , i have try to follow code and i cannot manage changeNumberOfUnits because of onclick function.

  • @sivas4061
    @sivas4061 2 ปีที่แล้ว

    What vs code theme you're using?

  • @21398403
    @21398403 ปีที่แล้ว

    Thanks for the video and please add a New video with paypal button.

  • @Toast917
    @Toast917 ปีที่แล้ว

    helping me with my APCSP class 🫶🙏

  • @sagarraut797
    @sagarraut797 3 ปีที่แล้ว

    I want to add discount facility or buy one get free, how can I do that?

    • @CodeExplained
      @CodeExplained  3 ปีที่แล้ว +2

      Add new properties to the products,
      {
      ...
      discount : 20,
      free_product: 1
      }
      and take those in mind when calculating the subtotal.

  • @jowarnis
    @jowarnis 2 ปีที่แล้ว +2

    dude is using innerHTML to create elements.. I just cant.. terrible

  • @deeeera
    @deeeera 2 ปีที่แล้ว +1

    Thank you so much for this tutorial. It's of great help.
    However, I do have a problem. Your tutorial works just fine. But you see, I have 4 different sections (where you have the '.product's class) of products but your tutorial only works for one section and as such, I have only one section of products and 3 empty sections when I load the page. What can I do?