Thanks Bob, Peter and Paul,

I persist the basket instead of using a session so that the user can return
later and still have the items in the basket (identified by a cookie). Old
records are cleared out periodically.

I've used the JSON trick before on other systems and it works well for
archiving, but it does make building views from it a bit of a pain. I was
hoping to use objects so that the email confirmation and views in the back
office were easier to code, but I guess it's a small price to pay :)

- John


On 9 December 2010 16:11, Peter Bell <[email protected]> wrote:

>
> On Dec 9, 2010, at 11:04 AM, Paul Vernon wrote:
>
> > By doing this, I only have one record that is stored permanently per
> order which is an "order record" which contains a full copy of the original
> basket and the transaction information as sent back from the payment
> gateway. The basket stores tax rates and costs of each item etc. so that
> when a basket is de-serialized, it shows the rate of tax as it was when the
> order was made.
>
> This is essential for any e-comm system. It's one of those cases where
> normalization doesn't work. Generally you don't want to have pointers to
> products, tax rates, shipping calculators, discount codes, addresses, gift
> certificates or anything else as the items you point to can change over
> time. Other approach is to implement versioning so you point to an immutable
> version of a product or address. That works, but it's typically more work
> than just having a denormalized copy of all of the info in the order and
> order item tables.
>
> Best Wishes,
> Peter
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "CFCDev" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<cfcdev%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/cfcdev?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"CFCDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cfcdev?hl=en.

Reply via email to