gadgets. Widgets have different sizes and colors; gadgets have
different weights. The price varies on the attributes. There may be
many, many different widgets and gadgets, that are uploaded by a
variety of sellers, but the only thing that affects price is size/
color for the widgets and weight for the gadgets. The sellers do not
have a choice about price; it is solely determined by the attributes
at the time the item is uploaded. At some point in the future,
additional attributes may be added (perhaps gadgets will get a height
attribute).
I need a table that says what the price is based on the attributes. It
seems like a tree would be a good choice:
Widget
-- Large
-- -- Green : $6
-- -- Blue: $8
-- Small
-- -- Green: $2
-- -- Red: $3
Gadget
-- Heavy: $10
-- Light: $5
The shop administrator will have the ability to change the values in
the tree, and add new branches, but any items already uploaded will
retain the price they were assigned at the time they were uploaded.
I will also have a table for items, which will hold the information
about each item for sale that the seller uploads. I can see how I
could determine the price using the info from the tree. But I also
need to be able to search for items based on attributes. Should I
store those in the table somehow? Or create a HABTM table with the
various attributes? Or perhaps referencing the node in the price tree
could somehow yield the info I need to search?
Thank you so much for your help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment