rubyonrailsin

A Ruby and Rails talk

Monday, March 15, 2010


Re: [spree-user] User Personalisation of Products

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit



On Sun, Mar 14, 2010 at 7:54 PM, peachygifts <m.ward@leythers.com> wrote:
> [spec]

this looks fine to me.

 
One thing that I am worried about is a line_item is only ever created
once for a variant (per order) and then has its quantity incremented
if a user wants more. Surely this means that I can't store different
personalisation details for any variant that has a quantity of more
than 1?


Correct. But you can supply your own version of add_variant and contains?  which is aware of the extra information. Actually, it should be enough to get contains? to return false whenever a variant (or its product) has personalisation information: this will prevent the same underlying variants being lumped together.

Note that you could also (temporarily) add information to a variant instance by adding an attribute to the class, and then test this attribute in your version of contains? (This is how we handle - or used to handle - the credit card numbers: it was only stored in the card instance and never persisted to database.) Adding an attribute to Variant might also simplify some of the logic for capturing the form results.

good luck!

Paul

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree-user@googlegroups.com.
To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive