Page 1 of 1

Need help with php code!

Posted: Fri Apr 01, 2011 1:50 am
by benji2010
Hello everyone,

Before I start, please forgive me if this seems simple to you. I am new to php and mysql.

I am setting up a e-commerce site and so far it is going very well but I have now hit a bit of a road block and need some help.

Two questions really. I have created my own simple CMS so I can load up html product pages without having to create new product pages!

1, In the CMS how do I have the option to place a drop down with 3 different colours. For example product 1 has 'black and 'white' whereas product 2 only has 'Brown' and product four has 'yellow and pink'. How would I in the CMS be able to write code that the admin could choose these for the specific products.

2, How would I go about having a size and colour drop down on an item and how would that work with php?

How would all of this work together?

Thanks for any help that I get!

Ben. :D

Re: Need help with php code!

Posted: Fri Apr 01, 2011 7:28 am
by benji2010
Can anyone please help me?

Thank you :)

Re: Need help with php code!

Posted: Fri Apr 01, 2011 7:50 am
by litebearer
Show us the coding you have tried thus far

Re: Need help with php code!

Posted: Fri Apr 01, 2011 8:09 am
by benji2010
Hi,

I haven't fully written the code for the cms as yet. What I need to know is how would I go about this?

How would I in the CMS be able to write code that the admin could choose these for the specific products?

Thanks,

Ben.

Re: Need help with php code!

Posted: Sat Apr 02, 2011 8:23 am
by benji2010
Can anyone help me? Please?

Re: Need help with php code!

Posted: Sun Apr 03, 2011 1:16 pm
by klandaika
What do you use to store you product information no? database or some other method?

if it is a database then what you would have to do is probably create another table where you woudl store the information about available options for each of your products.
Then on the display page you would create dorpdown boxes based on the data in the options table that corresponds to the item being viewed.

For administrator to be able to modify the options you would have make a either an admin page or a form which display only to administrator on the products page, upon submission a row would be added/deleted/modified when the administrator adds/deletes/modifies an option of the item.

Re: Need help with php code!

Posted: Mon Apr 04, 2011 1:34 am
by benji2010
Hey,

I think that i figured it out. Basically I am going to have several pages with which have different includes files. So one includes file will have a colour option of blue, one red and another pink. So I just got to have different admin panel options, with different form in the includes files.

Would this sound about right to anyone?

Thanks,

Ben.

Re: Need help with php code!

Posted: Mon Apr 04, 2011 5:34 am
by benji2010
So what do people think?

Would this work?

Re: Need help with php code!

Posted: Mon Apr 04, 2011 5:44 am
by klandaika
This isn't a traditional way of making product pages with custom options. It might work out for you, but changing things later on might get quite difficult.

Re: Need help with php code!

Posted: Mon Apr 04, 2011 6:10 am
by benji2010
So how would one go about it?

I am stuck and need all the help I can get.

Thanks,

Ben.