Storing selected product options in a shopping cart in CakePHP?

My approach was to try to stick to convention. I have a cart model, an item model, an option model and a value model (an option can have multiple values). Once I got it to there, everything fell in to place.

You need to set recursion to "3" but when you read the cart, you get everything perfectly laid out.

Up vote 0 down vote favorite share g+ share fb share tw.

I'm just not sure what to do when a user selects some options for the product and saves it to the cart. Do I add a new model called CollectionsProductOptions? What's the best way to store this kind of data?

Should I just serialize an array of selected options and save to the carts_products table? Mysql cakephp shopping-cart habtm link|improve this question edited May 4 '11 at 18:19random3,16541426 asked May 4 '11 at 16:28topherez1.

My approach was to try to stick to convention. I have a cart model, an item model, an option model and a value model (an option can have multiple values). Once I got it to there, everything fell in to place.

You need to set recursion to "3" but when you read the cart, you get everything perfectly laid out. I keep my cart products/options separate from my catalog products/options. On the cart side, an option only belongs to one product.

On the catalog side, an option can belong to many products. Your approach may be different. I do this because options may change and I don't want my old sales information to change.

I do this for all cart tables. The cart_products table is different than the products table. The product_options table is different than the options table, etc.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions