Create Simple Shopping Cart using PHP & MySql

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

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

  • @cyklatillbahamas
    @cyklatillbahamas 3 года назад +14

    This sounds like a tutorial by an AI for other AI's 😅

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

    after array unset add this code
    $_SESSION["shopping_cart"] = array_merge($_SESSION["shopping_cart"]);
    Otherwise you cannot add more items. when you add a new item it will be added in the place of the last item.

  • @mikerockwell4494
    @mikerockwell4494 6 лет назад +11

    Hi, thank you for your tutorial! When I add 2 products in a cart, the first product gets deleted in the Order Details. How do i fix this?

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

    When i run these showed me undefined variable which is in $id=Get_id line

  • @bitmoney4468
    @bitmoney4468 4 года назад +4

    I noticed a bug in the shopping cart. If you add item with negative it will deduct the negative value from the total price.

  • @roopbiswa
    @roopbiswa 4 года назад +3

    There is an error. If you remove 2nd product, and then add another product. This will replace the third product. Because you used count for indexing. Your index is not unique.

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

      @Biswarup Roy Chowdhury what should I use instead?

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

    The only thing I cannot handle is the automated voice you used or else I would've used your videos comeon man use a better listening voice or something.

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

      Same, had to mute...

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

      @@WatIsbiz I honestly don't understand why this guy didn't use a better voice over. ughhh

  • @munnumona123
    @munnumona123 5 лет назад +2

    Hey.. Can anyone please help me save the details of the items added in cart in a database ? (I use phpmyadmin).... it's urgent!!

  • @SmallkitchenBakes
    @SmallkitchenBakes 4 года назад +1

    The voice is not helping

  • @AbdallahBentounsi
    @AbdallahBentounsi 9 месяцев назад

    This is a very good video for the general idea of shopping cart, but at this examples code, working with array with index as key is a really mess when it comes to the "unset/remove" part of the logic, simply won't work in real life. You better prefer associative keys for best results.
    Weblesson always provide good and practical ideas to do stuff, many Thanks

  • @webslesson
    @webslesson  8 лет назад

    You can also check this Ajax Jquery Drag and Drop Shopping Cart using PHP Mysql - ruclips.net/video/veb_UsjKrdQ/видео.html

  • @st.apollonius5758
    @st.apollonius5758 7 лет назад +10

    I hate it when people upload a video and use Windows voice narration software......Annoying in a way I find hard to describe.

    • @marteltaylor-strickland4642
      @marteltaylor-strickland4642 6 лет назад +1

      don't let the voice stop you from learning it's free content, plus weblessons are a great source

    • @josephuzuegbu7431
      @josephuzuegbu7431 4 года назад

      @@marteltaylor-strickland4642 Why criticizing a resource u are getting freely. You didn't pay for this tutorial. do you?

    • @marteltaylor-strickland4642
      @marteltaylor-strickland4642 4 года назад

      @@josephuzuegbu7431 I'm not criticizing at all I value the information completely and technically yes I do pay since I've used RUclips premium to learn certain things

  • @vishalmishra1937
    @vishalmishra1937 4 года назад

    i need help i wanna send request to friend from list of friends by clicking on button in front of their name.how to assign functionality to each button click in php please help.
    here is snippet of code.
    while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
    echo ''.$row["name"].'';

    echo ' ';

    }

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

    Anyone who watched this video? I have confusion where did he get the $_SESSION["shopping_cart"] ?

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

    why can't you just read it for yourself? why do you use an automated voice!! i can't understand even after watching so many time. But thanks for the tutorial.

  • @solguardcompany5938
    @solguardcompany5938 6 лет назад +2

    what do i do after creating a simple cart?
    I want to be able to charge the total on the cart with stripe.
    Any tips are appreciated.

  • @axielyw3588
    @axielyw3588 8 месяцев назад

    it was useful till i pressed the add to cart button and it told me $values is an undefined variable

  • @nursaid7885
    @nursaid7885 5 лет назад +5

    I need help sir, how to save the item to the database once u checked out

    • @joshuataruc2385
      @joshuataruc2385 4 года назад

      hi sir if you already did this please teach me i really need this thank you

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

      insert the same array to database
      in insert query

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

    Can you please suggest how to perform checkout and payment after this I have used same code in my project

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

    this code give me this error: "Notice: Undefined index: id" in line 10 and 14

  • @Tommytsa1230
    @Tommytsa1230 5 лет назад +7

    still good in 2019, nice work man

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

      It's still working in 2021 man 😂

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

      you prolly dont care but does anyone know of a method to get back into an instagram account?
      I was stupid lost the password. I appreciate any tips you can offer me

  • @dhakprasadupreti6249
    @dhakprasadupreti6249 4 года назад +1

    Thank you very much for this great job. Thanks.

  • @beliydimas
    @beliydimas 6 лет назад +2

    Thank you. Your video helped me in the development of the thesis project.

    • @webslesson
      @webslesson  6 лет назад +1

      Oh, Thanks for share feedback with us.

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

    How to post these values to another form, through a button of type submit.

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

    why you add hidden field I cant understand will you please explain

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

    Nul

  • @jackysiew2707
    @jackysiew2707 6 лет назад +3

    Why i can't insert second item in shopping cart
    When i add another item into cart it display item added

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

    Can we see client history and shopping history here?

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

    Is this the only video or is there another one with the checkout option?

  • @leslieilagan4969
    @leslieilagan4969 8 лет назад +6

    how to display the ordered items in shopping cart to order page.

    • @takshot9941
      @takshot9941 6 лет назад +1

      Hi I am php laravel developer if you want develop some web app free way replay me!

    • @turfacreation
      @turfacreation 5 лет назад +1

      @@takshot9941 dear Sir, where r u from? I need some help for customisation a script. thanks

    • @takshot9941
      @takshot9941 5 лет назад

      @@turfacreation I am from Afghanistan what type of script need for customization.?

    • @turfacreation
      @turfacreation 5 лет назад

      Laravel framework, PHP script.

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

    i would like to know how to update the product quantity?

  • @shakimhossain6562
    @shakimhossain6562 6 лет назад +1

    Sir, Assalamulaikum, Your video very great. This all video helpful

  • @harshitpandey9705
    @harshitpandey9705 7 лет назад +1

    I have a stock column in my table. Can you tell me how to reduce the stock at the time of purchase? Thank you in advance :)

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

    Hi sir, so how i can add the items from to cart to database?

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

    Sir pls the order detail I'd no displaying

  • @muhammadaqibbinazam
    @muhammadaqibbinazam 6 лет назад +1

    That was helpful :)
    you can teach in your voice to that will be much better :)

  • @LMAO-zi7xe
    @LMAO-zi7xe Год назад

    How to display image in order details area?

  • @haloweed29
    @haloweed29 6 лет назад +1

    And how would it be for the information to keep it in the same td without creating more td.

  • @rinilgratil865
    @rinilgratil865 4 года назад

    Hi can you please help me for my program.

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

    what are you typing your code on ther???

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

    Sir items not showing into cart pls help

  • @TheJessicagardner
    @TheJessicagardner 4 года назад

    Sounds like a robot or AI talking

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

    When I'm selecting the first product, it doesn't display in the cart. how to fix this?

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

      But other products are visible in the cart when clicking the add to cart button

  • @kgmrnayanatharaka5939
    @kgmrnayanatharaka5939 4 года назад

    Not work your code i have sone errors..🥺

  • @s.i.k1407
    @s.i.k1407 3 года назад +1

    Good day can you make a option for the quantity to be changed in the Order Details section. Meaning the customer will add to cart and the Order Details will reflect the total price as if one item was selected (the quantity form is not there) but if a user wants to select more than 1 product they can do that from the order details (the quantity form will be here or if possible a plus and minus option like bootstrap ) instead of removing it from order details and selecting the amount and then adding back to cart?

  • @joannelai5873
    @joannelai5873 7 лет назад

    Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\FYP\product.php on line 62
    and theres no button and images shown in the webpage :(

  • @glorynwobi7396
    @glorynwobi7396 4 года назад

    can I be able to make transactions with it

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

    how do u store images in a table ???

  • @srinistark1661
    @srinistark1661 7 лет назад

    after checking in_array condition in your video in else part i want to add quantity only.. for i clicking one product again and again i want to do quantity increase like1,2,3,4,5...... how can i do????

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

    right side code is not visible.

  • @palashmitra7311
    @palashmitra7311 8 лет назад +1

    Nice tutorial. I expect more nice. Like, initially how to store items, how many items exist , and PayPal tranction.

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

    Hello, I have a problem. When I have 2 products in the cart and the first one is removed, the next product you add will overwrite the first one (which was the second one). My code is same as yours. Is there a solution?

  • @mustafaweb3325
    @mustafaweb3325 6 лет назад

    there's a problem with downloading the source code -> unknowing archive?!!!!

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

    very helpful thnaks

  • @TheBlackEyesGame
    @TheBlackEyesGame 5 лет назад

    its really easy and nice tutorial, but i am facing one problem that is i cant add more product. can anyone please help me how can i add more products? please help on this...as soon as possible. thanks Webslesson

  • @TC-kh4er
    @TC-kh4er 4 года назад

    Is somenone who could update the quantity ??? I need to find out how could i solve it.Please ,HELP!

  • @mobasherkazemi9758
    @mobasherkazemi9758 5 лет назад

    145/5000
    My site shows the position of people every few seconds, but I do not know how to save the position in the theme form in my database. Someone can do it.

  • @PanosAnas7
    @PanosAnas7 5 лет назад +1

    This is a very good video for the general idea of shopping cart, but at this examples code, working with array with index as key is a really mess when it comes to the "unset/remove" part of the logic, simply won't work in real life. You better prefer associative keys for best results.
    Weblesson always provide good and practical ideas to do stuff, many Thanks.

  • @sk.mahabuburrahman6306
    @sk.mahabuburrahman6306 7 лет назад +1

    If I select item 'A' twice n want to remove one of the item 'A's' it removes all of them. And image is not showing on the table please help

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

    2021 Toturial very good. Thanks!

  • @TheEntertainmentHub338
    @TheEntertainmentHub338 5 лет назад

    this video upload in hindi/urdu..plz...don't understand this language

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

    how to show image in cart

  • @formickaw
    @formickaw 6 лет назад

    What mean '0' in this line of code = $_SESSION['shopping_cart'][0] ? Thx for answers.

  • @krishdoshi4874
    @krishdoshi4874 6 лет назад

    My list is showing in vertical...I copied exact code u wrote..still it's in vertical ...not horizontal

  • @phpprojects
    @phpprojects 5 лет назад +1

    Thank you!. I want to ask if we close the browser and open it again, so will the items in cart remain as it is or they get cleared?

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

      $_SESSION variable will automatically clears its content after the browser gets closed.

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

      @@accounts6390 then what is the solution if cart items should be remain same in cart after added even though browser will close.

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

      @@saisatishethreyas9025 save them to a database

  • @ekramhossain1505
    @ekramhossain1505 4 года назад

    can you please make this shopping cart in laravel and ajax? ...

  • @gamerracoon6511
    @gamerracoon6511 4 года назад

    help me
    Warning: mysqli_query(): Couldn't fetch mysqli in index.php on line 96
    Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in on line 97

  • @SohailKhan-tc8uz
    @SohailKhan-tc8uz 4 года назад

    Where from this guy who makes best tutorial with gibberish sound.

  • @phoenixcode8034
    @phoenixcode8034 7 лет назад

    i'm a biggener of php programming please help me with my problem ,, please contact me

  • @SohailKhan-tc8uz
    @SohailKhan-tc8uz 4 года назад

    Where from this guy who makes best tutorial with gibberish sound.

  • @ivanenoria4168
    @ivanenoria4168 5 лет назад

    good morning ! what is the codes in

  • @སམིཡའནངཕོསམིངརི

    my code does not work, plz anyone help? when i click on add to cart button it does not add anything in the Order details.

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

    when inserting the images in the database, it becomes twice a time in the browser. can you help me

  • @cookedcarp2612
    @cookedcarp2612 7 лет назад +1

    Can you please help me? Whenever I click the add to cart, it says: Fatal error: Call to undefined function array_column() in C:\Users\Elisha\Desktop\USBWebserver v8.6
    oot\shopping_cart\shop.php on line 9. I don't know how to fix it :( I need this for my project

    • @lunarskyye2680
      @lunarskyye2680 7 лет назад

      Did you get sorted in the end?

    • @daalwada
      @daalwada 7 лет назад

      Download the latest version of phpMyAdmin tat supports array_column() feature.

  • @Onlypositivestuff
    @Onlypositivestuff 4 года назад

    Hi
    what if a product have more then one pictures ? does it works or it will repeat same product details with diff pictures

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

    how to insert into db?

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

    good work, but can you please provide the code for a checkout after the cart

  • @ISOnepal
    @ISOnepal 4 года назад

    How to save in php ?

  • @azizurrahmanjibon8752
    @azizurrahmanjibon8752 7 лет назад

    nice tutorial . how i send shopping data in database?please give me suggestion.

  • @sinumarinajacob9168
    @sinumarinajacob9168 7 лет назад

    Hello sir my image is not getting displayed in webpage from database..please help me

  • @sourovpal7485
    @sourovpal7485 4 года назад

    Boss how to create otp code system in mobile view , please make tutorial

  • @sisicasteloy5128
    @sisicasteloy5128 8 лет назад

    how can I put the available stock of the product that will be lessen with the input quantity of item to be bought?

  • @rodzynpl6861
    @rodzynpl6861 6 лет назад

    I've changed my base. Why do not I add it when I press the button?

  • @axstudio5022
    @axstudio5022 6 лет назад

    good day sir, what if i want to add quantity in the same item that i've get 1 then i have to add another one in the same item without notify me that the item is already added. but i want to add more beacuse like i forgot something to add another quantity in that same product , but the code blocked it and stick to only 1 selection .. how can i change that to add more without alert? please ,, thankyou !

  • @arnavsivaram9980
    @arnavsivaram9980 4 года назад

    where is the source code

  • @komchanhirunsai8226
    @komchanhirunsai8226 7 лет назад +1

    Thank you so much for this great video,but there is a problem when i try to remove item from the cart.Let's say I have 5 item in my cart when 1 delete item no.1(index 0) and add one more item (item no.6) the code will count the items in the cart first which is 4 items(item no.2 - item no.5) and then add the item to index 4 ,so the the item no.5 (index 4) will be replaced by the new item. I have no idea how to fix this problem. Thank for everyanswer :)

    • @marcustan2099
      @marcustan2099 6 лет назад

      Try using array_push, it should solve the problem.

  • @johnedelgonzales8963
    @johnedelgonzales8963 6 лет назад

    Hi! Anyone can help me ? I cant insert another item in the cart? Thanks in advance!

  • @dikembemoreno3810
    @dikembemoreno3810 5 лет назад

    Please help. When i click add to to cart it only adds the same item the last item in database. How to fix this?

  • @tenmillioncutie4858
    @tenmillioncutie4858 6 лет назад

    It always say that items already added and cant change quantity because of that.

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

    Thanks for this

  • @satyajeetsharma6038
    @satyajeetsharma6038 6 лет назад

    i don't want to show quantity in html form but i want to show quantity in cart table what can i do?

  • @johncristophersantos8289
    @johncristophersantos8289 7 лет назад

    sir how about you have a login then add to cart and this is the situation " one user log in then he add to cart then he log out then someone log in " how that the second
    user dont see the previews record pls help

  • @keitamohammed4579
    @keitamohammed4579 4 года назад

    thank you for the video... it is very helpful

  • @mohammedadnan196
    @mohammedadnan196 5 лет назад

    Bro please make the 2 nd part with PayPal integration

  • @oladimejiobileye7702
    @oladimejiobileye7702 7 лет назад

    how do you display not just the products but the products and the image in the cart?

  • @haloweed29
    @haloweed29 6 лет назад

    how to show value in the same td or input if you click on the database product. (In other words, only show a value in the same input if you click on add cart)

  • @christoferi9636
    @christoferi9636 6 лет назад

    that is good tutorial BUT is'not for the real life
    because as user i can change that "hidden" variables because that variables is POST
    Try it !

  • @mohammadzakirhossain1924
    @mohammadzakirhossain1924 4 года назад

    voice is very bad

  • @bizmax.official
    @bizmax.official 6 лет назад

    Code is not working in live server please help me.

  • @dodongclarianes393
    @dodongclarianes393 6 лет назад

    Bro Can You Give me All Code..Please..