Jump to content

[SOLVED] Shopping Cart.. HOW??? PHP ??? MySQL???


bri0987

Recommended Posts

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 dont have anything remottly 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

Link to comment
Share on other sites

advice: use a more informative and less demanding subject  ;)

 

For a shopping cart, you can do this in PHP, just PHP if you want to keep it simple and can have a PHP instant payment notification script for PayPal, or whatever your going to use, and you can have it e-mail you when someone has made a purchase.

 

You could also use a database to keep track of payments.

 

And as for the floating sidebar/panel I would be asking that question in the Javascript part of the forum  ;)

 

Regards ACE

Link to comment
Share on other sites

okay sorry about the subjet... I really did not know how to word it...

 

I get what you you'll are saying, but how can I learn more about making what those websites have.

 

Question: So those website are a combination of PHP and javascript -OR- PHP and AJAX ? is that the same as DHTML?

 

I'm new to all of this stuff... I have made  many dynamic websites for clients... No shopping carts.. All CMS (Client management systems) I thought this would be something I could learn as I go...

 

Am I going to have to tell this client that I cant do this job after 2 weeks of work or can I learn it and make this work? with the next 2  or 3 weeks?

 

What do you all think?

Link to comment
Share on other sites

AJAX is Javascript that communicates with Server Side Language; in this case PHP.

 

DHTML is Javascript and CSS working together to give visual effects.

 

You may or you may not be able to learn how to build a shopping cart in 2 or 3 weeks, depends on how well you absorb what you learn and if you know how to apply it to do what you need to do. But if you are unable to learn how to make a shopping cart; there are already other shopping cart services/software available out there for you to use in any website you create.

Link to comment
Share on other sites

if I were you i'd get the main script working first. so work on the cart, get it all working before jazzing it up and adding the other effects to it.

 

here are some links to tutorials on making a shopping cart: (searched google)

http://www.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart

http://www.brainbell.com/tutors/php/php_mysql/TOC_The_Winestore_Shopping_Cart.html

Link to comment
Share on other sites

there are already other shopping cart services/software available out there for you to use in any website you create.

 

on that note, if you have a webhosting plan with Cpanel, their is probably a shopping cart or 2 ready for you to use on your website.  ;) When dealing with shopping carts and money, you need to also take note of the security risks involved in such a subject, if you code it wrong, or don't put in enough, or any security, Things can get ugly.

 

A good start is to workout who will manage your payments, PayPal is probably the obvious choice, and if you do it that way, you will probably need to know how to make, and/or use Instant Payment Notification scripts(IPN for short).

Link to comment
Share on other sites

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.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart

http://www.brainbell.com/tutors/php/php_mysql/TOC_The_Winestore_Shopping_Cart.html

)))

 

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.

 

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

I think you've got everything pretty much sorted out, as for the 2 things you don't know yet.

 

here's the javascript to handle the dynamic pricing. http://simplythebest.net/scripts/DHTML_scripts/javascripts/javascript_49.html

 

and as for the payments just searching google will give you plenty of Instant Payment notification(IPN) scripts to use for your payments.

 

Regards ACE

Link to comment
Share on other sites

The javascript that was posted cant pull the products and the prices from the database...

 

...

 

How do I get a few radio buttons to grey out if another option in a different radio group is selected.. Any tutorials on that one...

 

Also you know any good video tutorials or good books? I'm better with videos.

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.