#10 How To Show Product In Cart In Laravel 9 | Laravel E-commerce Project Tutorial For Beginners

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 18

  • @jabirkhan8897
    @jabirkhan8897 2 года назад +1

    you should add only user id in cart table instead of name, address and phone. these things you can add in checkout option.

  • @roshannafiz8698
    @roshannafiz8698 2 года назад +1

    Like This

  • @salmasheikh3480
    @salmasheikh3480 3 года назад

    wow

  • @hiroshkoshilah_kulis808
    @hiroshkoshilah_kulis808 3 года назад

    How the quantity can be changed in admin's products table? (decrease quantity when user add some quantities into the carts table and how to increase product table quantity again when user remove items from the cart?)

  • @jamesclaveria2906
    @jamesclaveria2906 Год назад

    Attempt to read property "phone" on null how to fix this?

    • @nicanderr
      @nicanderr Месяц назад

      this error shows that there is no data in the phone field. you can manually insert from the phpmyadmin or add "?? ' '" right after $product->phone so it will look something like this: {{$product->phone ?? ' '}}. the ?? ' ' is to help bypass the error when there cant be any info found on a specific field

  • @kiranuk_90s
    @kiranuk_90s 3 года назад +1

    ErrorException
    Undefined variable $data (View: C:\Users\kiran\OneDrive\Desktop\laravelproject\ordersystem
    esources\views\user\product.blade.php)
    sir please give me a solution

    • @WebTechKnowledge
      @WebTechKnowledge  3 года назад

      You probably did not send data from controller properly

  • @happyhappy-jl6yq
    @happyhappy-jl6yq 2 года назад

    $count is undefined.
    Why throwing this error

    • @WebTechKnowledge
      @WebTechKnowledge  2 года назад +1

      When you are showing the cart data you also need to send the count from the controller to view.i also ahowed this in the video.. I think you fast forward that part

    • @happyhappy-jl6yq
      @happyhappy-jl6yq 2 года назад

      @@WebTechKnowledge
      I have thrown data from controller to view.

    • @WebTechKnowledge
      @WebTechKnowledge  2 года назад

      Did you also send the count to the cart view?

    • @HungLe-uj1ky
      @HungLe-uj1ky 2 года назад

      @@happyhappy-jl6yq in home controller you need to send count in view.home and showcart both and this will show

  • @md.alomgirhossainsummer182
    @md.alomgirhossainsummer182 2 года назад

    Undefined variable: count (View: F:\Ecommerce1
    esources\views\user\home.blade.php)

  • @shivamprajapati407
    @shivamprajapati407 2 года назад

    in the home controller I sent the count
    $count=cart::where('phone', $user->phone)->count();
    return view('user.home', compact('data', 'count'));
    but this gives an error in home.blade.php saying it is undefined here
    Cart[{{$count}}].....please look into this

    • @muddasirkhan2487
      @muddasirkhan2487 Год назад

      use this code into redirect function then its work, i think u use in index else function

  • @yosramahjoub
    @yosramahjoub Год назад

    ur email please