Ok, guys, for the past week, I have been searching for, downloading, and reading anything that I can about making a simple shopping cart. Sure, I found a lot of stuff, but, I just cannot put it together. I found these forums, and decided I would post my problem and hope for a result.

Here is the situation:

A buddy of mine and I are starting an online PC company, on which you can customize your own computer online. I have the simple shopping cart broken down like this:

  1. An HTML page/template that builds a form for the customer to select each component of their PC, using drop down menus.

-I need to know how to build templates so I only have to enter text for the page header and drop down menu contents, and only have to enter the number of drop down menus. This way, I do not have to build the design over and over.

  1. There will be several drop down list menus (10-20) per form template, and I would like to know what selection for each drop down menu the customer selects.

  2. As the customer makes selections in the drop down menus, I need a price (text box) to be updated, so as the customer builds his PC, the total price (with shipping and taxes) updates.

  3. When the customer is done making all of his selections from all of the drop down menus on the template, I need all of his selections sent to some sort of storage file, and I need the page to change to another page, which will be the shipping/contact page.

-The shipping/contact page will be a form in which the user enters his address, name, etc, so I know where to send his PC.

  1. I need the info from the first page with the drop down menus (PC customizations) and the customer's address info sent to my e-mail so I can send the customer's exact custom PC to his address.

  2. I need a third page, which will be the confirmed order page, that tells the customer the order has been placed. This page should show up if everything goes ok.


Ok, I summed it all up in 6 steps. Please, please help me out. I really need you guys to walk me through this step by step. Feel free to write code for me, please. I'm a newbie to PHP, but not to HTML or Javascript. I use Dreamweaver MX, I have Microsoft Access, and I have MySQL, but, I don't know how to set it up. My webhost is a .com, so I'm sure it has PHP and SQL extensions.

    I doubt very much that you will find anyone here who will write you a shopping cart. There are lots of things you will need which you have not considered yet.

    There are a number of ecommerce packages out there which just need installation and configuration - there's no need to reinvent the wheel.

    Check out osCommerce or "Miva Merchant".

      What else will I need?

      Oscommerce has too many thing that I don't need. I want to keep it simple.

        isn't it simpler to install a readymade solution than to write something from scratch?

          How about this: Can you guys help me one step at a time?

          How do I send the value of the items that the customer selects in the dropdown menus to another form (to list so they can see what they ordered), and to an e-mail address, so I can see what they ordered and send it to them?

          Here's a description:
          [DropDown Menu Selection] ----> Listed on Another Page ----> My E-mail Address.

            I'd recommend some tutorials first, so you understand what you're going to be showed. If you have any hope of actually learning PHP, you'll need ot become familiar with what everything does. (or at least the parts which deal with your project, at first)

            This is a really simplified version of selecting something from a drop down menu and saving it to a db and displaying it on the next page.

            <?PHP
            $connect= mysql_connect("localhost","root")
               or die("Could not connect to database in localhost !");
            mysql_select_db("your db here")
               or die("Could not select that database !");
            
            echo '<form action="fruit_selected.php" method="post">
            <select name="fruits">
                    <option value="Apple">Apple</option>
                    <option value="Pear">Pear</option>
                    <option value="Grapefruit">Grapefruit</option></select>
            
            <input type="submit" name="Submit" value="Submit" action="required">';
            ?>
            
            

            And then

            <?PHP
            
            $connect= mysql_connect("localhost","root")
               or die("Could not connect to database in localhost !");
            $result=mysql_select_db("your db here")
               or die("Could not select that database !");
            
            $fruits=$HTTP_POST_VARS['fruits'];
            
             $sqlquery = "INSERT INTO your table here VALUES('". $_POST['fruits'] ."')";
            $queryresult = mysql_query($sqlquery) or die(" Could not execute mysql query !");
            $sqlquery = "SELECT * from fruits";
             echo '
             <table>
            <tr>
            <td ><font face="Tahoma" size=2 color="black"><b>You selected this fruit!</b></font></td>
            <td><font face="Tahoma" size=2 color="black">'.$_POST['fruits'].'</font></td>
            </tr>
            </table>   ';
            ?>
            

              Ahhh, man, thank you so, sooo much! You abosolutely rockz0rz!!

              Ok, next I need to know how I would post multiple selections from multiple drop down menus. Maybe a 'for i' statement, or some sort of quanitity shortcut coding to make it count the number of drop down menus, and post each value, one at a time? Or, do I need to script each one, one after another?

              Also, how would I send those selections to my e-mail address so I know what the customer wanted?

                Surely someone can help me with sending information from several drop-down menus in a form to my e-mail address, using PHP?

                  I need to know how I would post multiple selections from multiple drop down menus. Maybe a 'for i' statement, or some sort of quanitity shortcut coding to make it count the number of drop down menus, and post each value, one at a time? Or, do I need to script each one, one after another?

                  One at a time is good. For a shortcut use foreach with the $key => $value syntax.

                  Also, how would I send those selections to my e-mail address so I know what the customer wanted?

                  mail.

                    Thanks, once again for your help. One last major step:

                    I need to know how I would pull values of the selections from the drop-down menu form...

                    to >

                    The Shipping Form, displayed as a list of items on the same page as the Shipping Form, which has text fields and a drop-down menu (states) for the customer to enter their shipping address and information...

                    to >

                    My e-mail address, with the Shipping Form values.

                    SO:

                    The information from the drop-down menu form is carried over to the Shipping Form and displayed.

                    That same information from the drop-down menu form is carried to my e-mail address WITH the information from the Shipping Form.

                    That way, I can see, in my e-mail, where to send the selections that the customer selected.

                      So, this is the basic mapping of said events:

                      Build Form > Confirm Order, Shipping Address, and Payment Options Form > Order Price is sent to Payment Option chosen by the customer, once payment is confirmed, Order and Shipping Address is sent to our e-mail > The Customer is taken to an Order Confirmed and Thank you page.

                      [case]
                      [psu]
                      [mobo]
                      [cpu]
                      [ram]
                      [gpu] Order Listing Send order listing to our e-mail address.
                      [hds] [name][e-mail] Make sure payment is confirmed on PayPal, etc.
                      [ods] [shipping address]
                      [fans] [payment options]

                      [ocs]

                        Write a Reply...