Laravel 8 E-com Part-23 : Display Cart items and remove items from cart in laravel 8 Ecommerce

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.พ. 2025
  • In this video, you will learn how to show the cart items the user has added in his cart. We will be making the increment and decrement quantity, along with the remove item button, in the cart page.
    Integrate Font-Awesome : • Laravel 8 E-com Part-2...
    Donate and get Source Code : www.fundacodes...
    Laravel 8 Ecom Playlist link : • Laravel 8 E-commerce P...
    If the video helps you, hit the like button and subscribe to the channel. If you have any doubts or suggestions, drop them in the comments below and i will answer them.
    Thanks for watching
    Follow me on instagram : / sharma_coder

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

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

    Attempt to read property "image" on null how can I fix this error ?

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

    sir mere pass sweet alert 2nd argument unfined ka error ara h baki cart add hore hen bs delet ni hore

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

    How can I show feature products details

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

    Sir while i click on the + or - button in quantity insead of increasing the value by 1 my is increasing by 2
    For example if my value is 1 and if i press the + button the value is 3 now instead of value 2 and similer with the - button
    if was working just fine upto video no 22 and after doing video 23 and reaching upto time 12:25(before adding the script for cart page button ) it started increaseing value by 2.

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

      You might have forgot to change the class name for decrease button in the js. The increase button is being called twice.

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

      can you explain indeatail more

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

    Did you update this project?
    I'm looking for the old project you did with laravel. Could you please give me the link?

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

      This is the one. Which link are you looking for?

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

    Sir, how can i show products with quantity in cart if same product is multiple times in cart table?

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

      In our video of add to cart
      th-cam.com/video/1o3TO0D5HbY/w-d-xo.html
      While adding to cart we have checked if the product is already there in the cart.. so that there wont be duplicate records of same product multiple times.

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

    the delete function is working fine on the last product added to cart but itt's not working on other items on cart i wonder why this is happening #help expected

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

      Hello can you give me the code? I mean in the Cartcontroller and the script?

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

    Hii i’m learning with your video swal not working in laravel 9 properly
    Can you help me?

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

    when i try to remove it says in the console Uncaught SweetAlert: 2nd argument ('undefined') is invalid any help

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

    Hello. Excuse me, i don't know in what video did you do the change on the navbar when you are logged in. Can someone please tell me in what video does he do that?

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

      or can someone comment the code of that file, please?

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

      @@marcosalonso7725
      @guest
      @if (Route::has('login'))

      {{ __('Login') }}

      @endif
      @if (Route::has('register'))

      {{ __('Register') }}

      @endif
      @else


      {{ Auth::user()->name }}




      My Orders




      My Profile




      {{ __('Logout') }}


      @csrf




      @endguest

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

    hello sir, i have a problem that is in the cart when i enter the item it works without problems both in quantity, but when in the cart there is more than 1 item, for example item1 1qty item2 4qty........ when i add one then everything increases and the number automatically follows the item I click, what's the solution, sir?

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

    when I use foreach nothing is showing under this loop.what is the solution

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

      Do you have data in your db?

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

    Sir agar hum php artisan serve ke bad add to cart kare to successful hota hai, but jab localhost par add to cart karte hai to console pe 404 aata hai. So what should I do ?????

    • @PramodKumar-bu8oe
      @PramodKumar-bu8oe ปีที่แล้ว

      i have been waiting for this ans....any give right answer

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

      How are you running the application without php artisan serve?

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

    $(this) is not working selecting All item what to dk

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

    Hi, when i'm logged in as Admin user i can't visit the 'cart' page. It will give me error: ErrorException / Attempt to read property "id" on null.
    When iam logged in as normal user it works and i get the 'cart' page.
    I know it's a bit strange to go to cart page as an Admin but i want to understand what's the problem.
    Because as an Admin i'm an logged in and Authenticated User right? Thanx

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

      It should actually work even with admin. Mine works.
      To solve your error, first check if you're getting the data in controller. If yes, then pass it to the view. Your query is returning null so you are getting that error.

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

      @@SharmaCoder I already did that dd($cartitems); getting all the data so that works.
      Only in view it shows the cart page with User login and not with Admin..getting null, very strange. Routes are oke. (EDIT) Problem solved! it had to do with the sidebar because i use a different sidebarmenu for Admin. Solved with debugbar ;-) Thanx Sharma Coder for quick reply!

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

    I got problem sir, .. let say, i have some item with different qty, when i click one them, making all the qty same

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

      If you have followed the previous videos, then just add the class name product_data in the div which is just after the container div..
      Refer video @ 5:22

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

      @@SharmaCoder
      Thank you so much, has been fixed. I still writting script js under view & card.blade, custom.js not working, owl.carousel not working i use pagination as well

  • @donaldmjbart-williams3144
    @donaldmjbart-williams3144 3 ปีที่แล้ว

    I have two problems with the shopping
    1. Unable to get total sum in the shopping cart
    2. Unable to remove the item from the list
    please hello. observed error
    Call to undefined method Illuminate\\Database\\Eloquent\\Builder::exist()"

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

      do you get the solution ?

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

    increment function is not working, can you please tell me the reason?

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

      th-cam.com/video/1o3TO0D5HbY/w-d-xo.html
      Here we have made increment and decrement for individual products.. the same code is used in this video with Little modification.

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

      @@SharmaCoder I have already completed part 22, add to cart is working perfectly fine, but in term of increment and decrement code is not working.

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

      Inspect in browser and Check the console tab in the developer tools..

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

      @@SharmaCoder I have already checked from network tab form browser, i didnot get error... but the problem is in the button, because when i press plus value is not increasing.

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

      is there any dependencies?

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

    [HTTP/1.1 500 Internal Server Error 234ms] Eroor ??

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

      Go to the networks tab in the developer tools and click on the url you are getting the error from. You will get the error message which is causing the error.

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

      @@SharmaCoder try { r.send(i.hasContent && i.data || null) } catch (e) { if (o) throw e }

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

      @@SharmaCoder please notice my message

    • @IssOu-hw3eh
      @IssOu-hw3eh ปีที่แล้ว

      @@najwasya tu as trouvé solution de l 'erreur 500 interval server ?

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

      @@IssOu-hw3eh English please