View Full Version : Best way to implenment cart options

04-19-2012, 09:51 PM
Hi I'm trying to code a simple lightweight and safe cart, mostly complete, but
I am having a problem deciding on the best way to implement a option
when needed like color, weight etc. there's no admin of course I'll' just add
a product directly into the table or write a simple one later if ever needed.

I will be using a lot of the same type drop down options over and over,
should I create a options table or use a function instead. like select
radio etc and just call that when needed feeding array values or something.

Just wondering how some of you guys might implement something like this
although I'm not great at this stuff I never thought the option part would
be the thing that stumped me.


04-19-2012, 09:58 PM
I find that the simplest way is just to add a fields to the product table, and uyse comma delimited options.

for example: Color "Red,White,Blue"
in your code, just Explode() the value by comma into a SELECT dropdown menu.

then gather your options, put them into one string and insert them into an options field in your shopping cart table or session.