ycoleman Posted April 7, 2007 Share Posted April 7, 2007 I am trying to create a shopping cart for my toy store website I am not sure where to start. Can somebody help me???? Quote Link to comment Share on other sites More sharing options...
Zaid Posted April 7, 2007 Share Posted April 7, 2007 I am trying to create a shopping cart for my toy store website I am not sure where to start. Can somebody help me???? hello, firstly, do not use !!!!!! in the title, it's kinda rude. secondly, provide more information: can you code php or are you actually looking for a cart package to install? either way, grab this book How to Do Everything With PHP and MySQL Chapter 7 Sample Application: Session-Based Shopping Cart unless you have more specific question, it's difficult to help you. Quote Link to comment Share on other sites More sharing options...
per1os Posted April 8, 2007 Share Posted April 8, 2007 www.pinnaclecart.com is a great cart or www.oscommerce.com Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted April 8, 2007 Share Posted April 8, 2007 yeah. please expand on your queswtion, is it code that your looking for ( WE WILL NOT CODE IT FOR YOU ), or tutorials, or just examples, or is it opensource installers like forums ( phpbb or SMF) what is you want? thankx Quote Link to comment Share on other sites More sharing options...
ycoleman Posted April 9, 2007 Author Share Posted April 9, 2007 All I'm asking is how to create a shopping cart, I didn't ask for any sarcastic replies. What is the point of you guys having this forum and you can't help anybody. If you don't have the anwser to my question or any resources I can go too then don't post anything!! I have tried many ways to and looked everywhere fopr guidance on how to do these functions, but I'm only asking nicely. I am not looking for you guys to do it for me, just give me some examples like you guys gave the other users. Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted April 9, 2007 Share Posted April 9, 2007 All I'm asking is how to create a shopping cart, I didn't ask for any sarcastic replies. What is the point of you guys having this forum and you can't help anybody. If you don't have the anwser to my question or any resources I can go too then don't post anything!! I have tried many ways to and looked everywhere fopr guidance on how to do these functions, but I'm only asking nicely. I am not looking for you guys to do it for me, just give me some examples like you guys gave the other users. look in my signature and read everything under the category 'basic'. everything. then, hit the forums. we cannot/will not help you unless you are willing to help yourself. Quote Link to comment Share on other sites More sharing options...
ycoleman Posted April 9, 2007 Author Share Posted April 9, 2007 > > Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted April 9, 2007 Share Posted April 9, 2007 Like the others have said, we will help you if you ask questions about code you've already written. If you have code you've written that is giving you trouble, post it along with an explanation of the problems. Ken Quote Link to comment Share on other sites More sharing options...
Barand Posted April 9, 2007 Share Posted April 9, 2007 I'd start by Googling "php tutorial shopping cart" Quote Link to comment Share on other sites More sharing options...
cmgmyr Posted April 9, 2007 Share Posted April 9, 2007 try http://www.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart Quote Link to comment Share on other sites More sharing options...
ycoleman Posted April 11, 2007 Author Share Posted April 11, 2007 Thank you guys for the resources to my questions. I went to the "Building a simple PHP shopping cart" site" and I typed in the code in but I get a parse error in line 124 which is where the $total variable is located: Did I forget something or did I put one too many brackets? Here is the code I have so far: <?php $_SESSION['cart'] ='tblProduct'; function writeShoppingCart() { $cart = $_SESSION['cart']; if (!$cart) { return '<p>You have no items in your shopping cart</p>'; } else { // Parse the cart session variable $items = explode(',',$cart); $s = (count($items) > 1) ? 's':''; return '<p>You have <a href="shoppingCart.php">'.count($items).' item'.$s.' in your shopping cart</a></p>'; $cart = $_SESSION['cart']; total = 0; $output[] = '<table>'; foreach ($contents as $id=>$qty) { $sql = 'SELECT * FROM tblProduct WHERE ID = '.$id; $result = $db->query($sql); $row = $result->fetch(); extract($row); $output[] = '<tr>'; $output[] = '<td><a href="shoppingCart.php?action=delete&id='.$id.'" class="r">Remove</a></td>'; $output[] = '<td>'.$title.' by '.$author.'</td>'; $output[] = '<td>£'.$price.'</td>'; $output[] = '<td><input type="text" name="qty'.$id.'" value="'.$qty.'" size="3" maxlength="3" /></td>'; $output[] = '<td>£'.($price * $qty).'</td>'; $total += $price * $qty; $output[] = '</tr>'; } $output[] = '</table>'; $output[] = '<p>Grand total: £'.$total.'</p>'; } echo writeShoppingCart(); } ?> Quote Link to comment Share on other sites More sharing options...
damienwc Posted April 11, 2007 Share Posted April 11, 2007 ycoleman..... if all else fails try this. I use this on my site and havent had any problems with it, plus its free. http://opensolution.org/?p=Quick.Cart Quote Link to comment Share on other sites More sharing options...
ycoleman Posted April 23, 2007 Author Share Posted April 23, 2007 Thank you I'll Check it out Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.