graham23s Posted February 11, 2008 Share Posted February 11, 2008 Hi Guys, im using this piece of code for the products on my e-commerce site: $display_box = "<div align=\"center\" id=\"right\">\n"; $display_box .= "<div class=\"boxtop\"></div>\n"; $display_box .= "<div class=\"box\">\n"; $display_box .= "<p><img src=\"images/image.gif\" alt=\"Product Image\" title=\"Product Image\" class=\"image\" /><b>$product_name</b><br /><br />consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis.<br /></p>"; $display_box .= "<div class=\"buttons\"><br /><a href=\"shoppingcart.php?productid=$productid\"><img src=\"images/cart_navy.gif\" border=\"0\"></a><br /><br /><b>Quantity:</b> "; $display_box .= "<select name=\"quantity\"><option value=\"1\">1</option><option value=\"2\">2</option><option value=\"3\">3</option>"; $display_box .= "</select></div>\n"; $display_box .= "</div>\n"; i can pass through the product id fine by just GET on the next page but im not sure how to grab the quantitly and pass it through any ideas would be great <a href=\"shoppingcart.php?productid=$productid\"> cheers Graham Quote Link to comment https://forums.phpfreaks.com/topic/90551-getting-the-quantity-in-shopping-cart/ Share on other sites More sharing options...
mainewoods Posted February 11, 2008 Share Posted February 11, 2008 <a href=\"shoppingcart.php?productid=$productid&quantity=$quantity\"> Quote Link to comment https://forums.phpfreaks.com/topic/90551-getting-the-quantity-in-shopping-cart/#findComment-464292 Share on other sites More sharing options...
cooldude832 Posted February 11, 2008 Share Posted February 11, 2008 Did u build this shopping cart? Get isn't a great method to do things only cause users like to hit refesh a lot. I'd try an ajax or post version maybe. Quote Link to comment https://forums.phpfreaks.com/topic/90551-getting-the-quantity-in-shopping-cart/#findComment-464308 Share on other sites More sharing options...
graham23s Posted February 12, 2008 Author Share Posted February 12, 2008 Hi Guys, yep i'm trying to build it lol, so do you think i should just have hidden fields with the product id in them? cheers Graham Quote Link to comment https://forums.phpfreaks.com/topic/90551-getting-the-quantity-in-shopping-cart/#findComment-464447 Share on other sites More sharing options...
cooldude832 Posted February 12, 2008 Share Posted February 12, 2008 well I mean if your doing it yourself I'd recommend ajax based its a lot cleaner. Also OOP is great for a shopping cart Quote Link to comment https://forums.phpfreaks.com/topic/90551-getting-the-quantity-in-shopping-cart/#findComment-464452 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.