poolhustler86 Posted February 28, 2008 Share Posted February 28, 2008 I am only just starting to get into php... and found this table i like on a major companies website (http://www.signet.net.au/Catalogue/browse.aspx?sid=586) basically i would like to know how they create this dynmaicly only the data table..where the prices are located. i have my ideas on how it would be created.. each in a single row in a database grouped up with a product... but i have no idea how to make sure i have the right qty when the user enters a qty in...to give them the right price... also.. how do you get the add to cart button... to add products to a database table.. if u enter qtys in 2 or more items... just asking how you would go about doing this... solutions / ideas would be most helpful! Quote Link to comment Share on other sites More sharing options...
spikeon Posted February 28, 2008 Share Posted February 28, 2008 dude, just use google checkout or paypal checkout they do that, for free, and its alOT less work Quote Link to comment Share on other sites More sharing options...
spikeon Posted February 28, 2008 Share Posted February 28, 2008 https://www.google.com/accounts/ServiceLogin?service=sierra&continue=https%3A%2F%2Fcheckout.google.com%2F%3Fgsessionid%3DrVT2UOgK4bY%26upgrade%3Dtrue&hl=en_US&nui=1<mpl=default_new Quote Link to comment Share on other sites More sharing options...
poolhustler86 Posted February 28, 2008 Author Share Posted February 28, 2008 i cant use google checkout.. cause it will connect up to an internel order system... Quote Link to comment Share on other sites More sharing options...
spikeon Posted February 28, 2008 Share Posted February 28, 2008 are your products not on the level? honestly, this is hard. you'll probably want to re-post this into the freelance section and pay someone Quote Link to comment Share on other sites More sharing options...
poolhustler86 Posted February 28, 2008 Author Share Posted February 28, 2008 id rather learn for my own benefits... it would be two tables... one table with product information... like the bullets..for description, and name... and then... another table with the qty breaks... i have down it with qty on each rows... but it doesnt look pretty... i want to know how to get it in that format... Quote Link to comment Share on other sites More sharing options...
trq Posted February 28, 2008 Share Posted February 28, 2008 What part exactly are you stuck on? Quote Link to comment Share on other sites More sharing options...
poolhustler86 Posted February 28, 2008 Author Share Posted February 28, 2008 creating the table part... cause sometimes some products dont have 2nd and third qty breaks... aswell as the button to loop through the records that have qtys in them and add them to another table in the database... Quote Link to comment Share on other sites More sharing options...
trq Posted February 28, 2008 Share Posted February 28, 2008 There is a snippet in our repository (here) that may help you. Quote Link to comment Share on other sites More sharing options...
poolhustler86 Posted February 28, 2008 Author Share Posted February 28, 2008 that may help... i will fiddle with that tomorrow... but how do you go about... collecting data from the table... when the user clicks add to cart... and insert it into the database.. it might be only one field.. but it could be 10 different colour variations..etc.. Quote Link to comment Share on other sites More sharing options...
trq Posted February 28, 2008 Share Posted February 28, 2008 You need a tutorial on how to collect data from a form and your looking at building a cart? I think you may need to start with something allot more straight forward first. Quote Link to comment Share on other sites More sharing options...
poolhustler86 Posted February 28, 2008 Author Share Posted February 28, 2008 i already know how to build a cart... and creat payment gateways.. but i didnt have a product that has multiple sizes, etc.. is it just a loop with the collected data? i just dont know how to give each different row.. a field name different... etc.. thats the part im stuck on.. and how to get it to insert into a table in mysql.. the rows with data in them from one button.. i was going to do it.. with multiple add to cart buttons... but im trying to understand loops / foreach statements and everything like that basically i know how to insert / retrieve data and select data from databases... and make my system work.. but for multiple sizes of a product i cant get it to work.. ive tried for months... Quote Link to comment Share on other sites More sharing options...
haku Posted February 28, 2008 Share Posted February 28, 2008 I also think you are trying to do something that sounds like its well beyond your abilities, but if its just something you are stuck on, lets see your code and maybe we can help you figure it out. Quote Link to comment Share on other sites More sharing options...
spikeon Posted February 28, 2008 Share Posted February 28, 2008 http://www.phpfreaks.com/forums/index.php/topic,181837.msg826044.html#msg826044 see the info feild there? perhaps something like that would work for you. its DIRTY as hell, but it might help Quote Link to comment Share on other sites More sharing options...
poolhustler86 Posted February 28, 2008 Author Share Posted February 28, 2008 i do not believe its beyond my abilities... im just trying to get my head around the logic side of it... and a piece of sample code (cant find on the web) for how to create dynamic fields with different numbers so i can add into database if customer puts more than 1 qty in one different size... Quote Link to comment Share on other sites More sharing options...
trq Posted February 28, 2008 Share Posted February 28, 2008 is it just a loop with the collected data? i just dont know how to give each different row.. a field name different... etc.. Ok, now your confusing me. I'm really not sure what you meen here. Where exactly are you stuck? Quote Link to comment Share on other sites More sharing options...
haku Posted February 28, 2008 Share Posted February 28, 2008 If its not above your abilities, then show us your code, and maybe we can help show you where you are going wrong. We can't help anything without seeing your code. Quote Link to comment Share on other sites More sharing options...
poolhustler86 Posted February 28, 2008 Author Share Posted February 28, 2008 i need the logic for this part... the table is fine.. i know how to set up that in a way that would be suitable... at the end of the table there is a qty box... however.. there could be 1 qty box.. or there could be 20 qty box per one product.. depends on the number of different sizes / colours or products... how do u do that part.... i could do it all with manual numbers.. at ends of fields and have like 100+ variables already declared.. but thats just ugly! Quote Link to comment Share on other sites More sharing options...
spikeon Posted February 28, 2008 Share Posted February 28, 2008 ...did you READ my post??? Quote Link to comment Share on other sites More sharing options...
spikeon Posted February 28, 2008 Share Posted February 28, 2008 storing a imploded aray in the database is how you do it Quote Link to comment Share on other sites More sharing options...
trq Posted February 28, 2008 Share Posted February 28, 2008 Ok, hang on a sec. You keep talking about tables and fields, are you talking about html tables/fields or database tables/fields, this whole post is getting a lilttle confusing. Quote Link to comment Share on other sites More sharing options...
trq Posted February 28, 2008 Share Posted February 28, 2008 Spike, storing an imploded array within a database is never a good solution. Quote Link to comment Share on other sites More sharing options...
haku Posted February 28, 2008 Share Posted February 28, 2008 edit: mistaken post. Replied to wrong poster. Quote Link to comment Share on other sites More sharing options...
spikeon Posted February 28, 2008 Share Posted February 28, 2008 foreach($size as $key => $value){ $db .= "|".$key."=".$value; } it'll store all the sizes in one row. save you the trouble of those nasty higher-skilled mysql stuffs Quote Link to comment Share on other sites More sharing options...
spikeon Posted February 28, 2008 Share Posted February 28, 2008 and, thorpe, i see no reason why not too. if you can pull it everywhere you need it just the same, and explode it, its like .00000003 ms longer plus, explode and related are used alot of the time for GET and POST, so why not DB? 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.