Jump to content

Shopping Cart Help.. Using Javascript and PHP...


bri0987

Recommended Posts

((( I was told it would be best to post this on this Forum not the PHP forums... ))) (FYI: I know like no Zero javascript)

 

(((Just for my peace of mind - I know what Ajax stands for but - AJAX means: the process of using Javascript and a server language (like PHP)  Together - right? )))

 

Please look at these 2 pages:

 

http://www.element-tech.co.uk/build.php?products_id=470

 

http://www.alienware.com/configurator_pages/Aurora_7500_b.aspx?syscode=PC-AURORA-7500-B&subcode=SKU-DEFAULT

 

 

This is what I need. I Know some PHP and MySQL.

 

I have been sitting in front of my computer for 2 weeks know and I still don't have anything remotely close to this stuff.

 

How do these pages have a price at the end of every item and that price updates and charges when they click on other items.

 

ALSO....

 

How do I get that floating window on the right side of the screen?

 

Thanks for all that help.

 

Brian

 

--------------------- Other Entry ----------------------

 

Some details about the project I'm working on...

 

Client is a custom computer company. Who sells high performance built computers to general public.

When a user clicks on a Gaming PC or Workstation PC or Home Media PC ... he/she will be taking to a page where just can choose the options for their custom built computer.

 

Options like the processor, motherboard, memory etc. etc. They will also have the option to click on more details and and a popup window with display more details of the current option. For EXAMPLE: If theres 5 different processors to choose from they can click on a little button next to each and it will show a large image and specs and detail blah blah... But Once they choose the processor the next area right below there selection will need to grey out certain motherboards that may not accept their choosen processor.

(((--

I was trying to do all of this with radio buttons like:

http://www.element-tech.co.uk/build.php?products_id=470

and

http://www.alienware.com/configurator_pages/Aurora_7500_b.aspx?syscode=PC-AURORA-7500-B&subcode=SKU-DEFAULT

--)))

 

I have a database set up ... I get the query info and set an array for the products by there catagorys (ie: motherboard, CPU, memory, etc...) I use a while loop to List the catagorys and another while loop inside that to list the items in that catagory.

 

I pasted an example of the code below...

 

The part that I don't understand is.. How do I get the prices to change and show up like in the example companies above. So it wont show the REAL price of the item... it will just show if the price will subject from the current price or add to the current price. (I hope I described that right??). THEN if someone chooses an option the other option prices will change and reflect there differences.

Also I would like to have that floating price window, but I dont need it, How would I do that, where is a good place to start??

 

NEXT - At the end of the page when the user is ready that click BUY or ADD TO CART or whatever... I'm assuming I have to set a session so that the information will pass over to the next screen and show ONLY "ONE item" (the name of the Game PC) and "ONE PRICE" (the final price) and show details about the item (The details that they have choose with no prices just the names.)....

 

FINALLY - (this stuff I don't understand either) :: the user is ready and then click next. I will have a SSL for the client so the customer and use a payment gateway to process the payment (credit card) probably Authorize.Net (I heard that were very good)... I have never done this e-commerce before so I'm hoping that all my hard work will just merge with the payment gateway and I don't have to right some crazy scripts for this to work because I would just kill myself (just jokin). Most of the PHP site I have done are CMS sites and the users/customers contact the company via phone or contact forms.

 

HERE IS THE CODE I PROMISED: /////

 


<div id="divBody">
  <div id="divBody_content">
  Body Content Below Here
  <br />
<?php if (!is_null($sel_product)) {
   echo $sel_product["name"];
   } else {
   echo "<h2>DEFAULT PAGE HEADING TEXT HERE.</h2>";
   } ?>
  <br />

  <form id="form1" name="form1" method="post" action="">
  <p>
<?php
   // 3. Perform database query
$query = "SELECT * FROM catagorys ORDER BY catagory ASC";
$catagorys = mysql_query($query, $db_connection);
confirm_query($catagorys);

// 4. Use database retured data
while ($catagory = mysql_fetch_array($catagorys)) {
   $catagory_name = $catagory["catagory"];
   echo "<strong>{$catagory_name}</strong> <br />";
   
   // 3. again
   $query = "SELECT * FROM products WHERE id_catagory = {$catagory["id"]}";
   $products = mysql_query($query, $db_connection);
   confirm_query($products);
   
   // 4. agian
   while ($product = mysql_fetch_array($products)) {
   echo "<label><input type=\"radio\" name=\"{$catagory_name}\" ";
   echo "value=\"{$product['id']}\" /> {$product["name"]} ";
   echo "[ " . ($product['price'] - $price_start) . " ] </label>";
//   echo " <a href=\"\">oOo</a> <br />";
   echo "<a href=\"#\" onclick=\"MM_openBrWindow('product.php?product={$product['id']}','DreamMachine','scrollbars=yes,width=600,height=550')\">GET DETAILS</a><br />";
   }
   
}
?>

 

I hope this helps... Let me know what you all think??

 

Thanks again for the replys.

-Brian

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.