-3

I am a beginner web developer and working on a school project. My apologies for asking this basic question. I am trying to create an online shopping store. What I am trying to do is when the user clicks on the checkout button, the shopping cart page gets updated with that element.
I don't know how to accomplish that. I really appreciate if someone can point me to a tutorial or provides some tips.

Victor Leontyev
  • 8,488
  • 2
  • 16
  • 36
user1836957
  • 427
  • 2
  • 9
  • 24
  • Shopping cart page gets updated with 'what' element? Your question is not clear. – Dhiraj Oct 23 '17 at 16:53
  • Sorry about my bad explanation. For example if the user likes a purse and clicks on checkout button to buy it, on the shopping cart page , that product (its image, its price, its color and size for example) is added to the shopping cart page. – user1836957 Oct 23 '17 at 17:01
  • There are lots of ways to do it I recommend you to watch some tutorials on Youtube, rather than to ask it here. This place is not so much suitable for general and open-ended questions like this. – Dhiraj Oct 23 '17 at 18:05

2 Answers2

0

Your question is really abstract, however you will have to find the right way to communicate with a database...it might be php/MySQL with laravel or some other framework or preferably C# asp.net with entity framework(that's what I will go with its not mandatory some people like php) Then you need to learn some lambda or sql depending on which approach you would like to take (php/C#). You will probably need to get some kind of grid control for the cart asp.net has default one personally I find it confusing and hard to work with( there are many controls that can be downloaded freely without charge for non commercial products search google) then you would need to fill that grid with the List of objects that you will get from your database. If you get that far alone the next steps would be easy you will probably need some javascript for ajax calls to a webservice or either your backend so you can submit the orders. For the right tutorial there is none actually since your question covers several topics regarding database modeling, data fetching, backend development and front end development. You can start by getting yourself some kind of server (look for mssql for asp.net) and MySQL for php, then you should look for some kind of database modeling tutorial basic tables relationships 1-1 1-* *-1, after that you would need to do your design (from the question I assume that you already have one downloaded). Then if you got down to this step you should google the way for the right way of communicating with your database from the backend of your website (I advise entity framework its clean and easy) you can generally bind the list of objects directly do the grid that would represent your cart (I say grid but you can give it data template to look like html, not to be confused with regular tables). If you really get here I see no reason to keep coding for a school project in most places you can use all this to bachelor degree exam and pass with straight A. But if you want more details look into these videos they explain quite well what you want to do.

https://www.youtube.com/watch?v=s91pPLx_T3Q

https://www.youtube.com/watch?v=yYr0seXj7qA

https://www.youtube.com/watch?v=lFkXk5gHjSs

-1

I am not great at JavaScript but I think your page would need to update a cookie then read that value from said cookie. I hope that's a good place to start!

You might also find "Creating a Shopping Cart using only HTML/JavaScript" helpful.

James Geddes
  • 742
  • 3
  • 10
  • 35
  • Why was this answer, as well as the one provided by @Kristifor Milchev, given a down vote? I think these are both helpful answers! – James Geddes Oct 24 '17 at 16:52