This worked well for me,
Bob
> --
> You received this message because you are subscribed to the Google Groups "CFCDev" group.
> To post to this group, send email to cfc...@googlegroups.com.
> To unsubscribe from this group, send email to cfcdev+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en.
>
>
--
Bob Silverberg
www.silverwareconsulting.com
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 great in the UK as in the last couple of years, our VAT rate has gone from 17.5% to 15% to 17.5% and in January it's going up to 20% so for online e-commerce stores that have been going for a while, being able to store this sort of data for tax reasons is very important.
Paul
> 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
--