qxonn Posted June 9, 2011 Share Posted June 9, 2011 Hi everyone. I'm a very inexperienced PHP coder who is helping out on an ecommerce site (osCommerce 2.2). We lost our main PHP guru and I'm trying to wondering if anyone can help point me in the right direction. At the bottom of every product page there is a link that goes to an index of forms that they can fill out for a quote. We want to take the user to the correct form to help them save time from having to select the right one. The "right one" depends on what product they are viewing at the time. We have about 15 different forms for over 85,000 products. This is what we are thinking: create and assign each product a "product_form" in MySQL, and then define & assign that integer to the correct quote form. When you click on the link it reads "product_form" and then loads the right form for whatever product page you where currently on. Basically, I have a general theory and understanding that this way would be the easiest for us to implement (as far as the database and managing 85,000 products). But I am open to other ideas. I am completely ignorant in this so if you want to just forward me links to read about how to do this that would be a huge step in the right direction. I think I could figure it out. Thanks! Quote Link to comment Share on other sites More sharing options...
xyph Posted June 9, 2011 Share Posted June 9, 2011 That's probably your best idea. Pretty much a parent/child relationship. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted June 9, 2011 Share Posted June 9, 2011 hmmm, 15 forms for 85,000 products. How is this form distinction decided? by category? by type? by country? something else? (there's gotta be something). Imagine there is a category (or 15 in this case) it would be as easy as having the form files with the same name as the respective category. Really depends on what other data you have in each product. Quote Link to comment Share on other sites More sharing options...
qxonn Posted June 9, 2011 Author Share Posted June 9, 2011 hmmm, 15 forms for 85,000 products. How is this form distinction decided? by category? by type? by country? something else? (there's gotta be something). Yes, you are totally correct. Categories where considered but there are over 400 categories (it's a heavy industrial sales website in case you are wondering) and I thought creating a entirely unique entry in mysql would be the most flexible and straightforward. My intention was to create a new "product_form" entry in the database that would be an integer of 1 - 15. 0 would take you to a generic form page. I would have to do some mapping, but I'm not sure how. Any examples of a process like this would be the most beneficial. Even just the appropriate topic to search google with ;-) Quote Link to comment Share on other sites More sharing options...
xyph Posted June 9, 2011 Share Posted June 9, 2011 You're pretty much going to have to do this manually. You could declare the form type on the category page instead, and join it with the product query. This assumes all products in a given category will use the same form. Otherwise, you'll have to assign a per-product value, and unless there's some information given in the table that would hint at the type of for a given product will have, it's all manual. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted June 9, 2011 Share Posted June 9, 2011 yeah, that's why i was trying to find another criteria. adding that database id is fine, but then you have to map 85,000 products. Quote Link to comment Share on other sites More sharing options...
qxonn Posted June 9, 2011 Author Share Posted June 9, 2011 Oddly enough, per product won't be an issue and are OK with the time it will take. Without going into too much detail, we would appreciate the flexibility it would give us. The issue for me is how to code it... I'm searching for examples and I have a few books but I'm just too newb... Thanks for your replies guys, it makes me feel good that I am headed in the right direction with what needs to be accomplished. Maybe I just go hire someone ;-) Quote Link to comment Share on other sites More sharing options...
xyph Posted June 9, 2011 Share Posted June 9, 2011 Probably your best bet. Hiring a qualified programmer saves you from having to worry about the huge security issues involved with dealing with anonymously-provided input. 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.