Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
04-19-2012, 08:51 PM #1
- Join Date
- Apr 2008
- United States
- Thanked 0 Times in 0 Posts
Best way to implenment cart options
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, 08:58 PM #2
- Join Date
- Apr 2004
- Toronto, Ontario
- Thanked 122 Times in 122 Posts
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.