Closed matthiask closed 12 years ago
Opinions? 76a9176c2bbe873d063f01fe77179d68e3c489c7
Not such a good idea after all.
Hi,
I cannot see an Discount or AppliedDiscount being added to an order anywhere throughout plata. Where would be the best place to add my discount model to the order? E.g. I have a book at a set price but if someone buys three at a time, they should get 20%. I understand the Discount class and the order_item_query stuff, but it seems the AppliedDiscount is never added to the order when it is created. So when should it be added? What is the design behind this?
Hi @felixSchl
It's the Discount
instance which adds a corresponding AppliedDiscount
to the order:
https://github.com/matthiask/plata/blob/master/plata/shop/forms.py#L111
The logic is contained in a form because it's much easier to replace forms than view code (which would not be that hard either).
Hi,
So what I ended up doing now is I created an order processor called "DefaultDiscounts" which adds a whole bunch of discounts to the order by default but which are only valid provided that they validate given a orderItem instance later in the process.
On Thu, Dec 6, 2012 at 9:47 PM, Matthias Kestenholz < notifications@github.com> wrote:
Hi @felixSchl https://github.com/felixSchl
It's the Discount instance which adds a corresponding AppliedDiscount to the order:
https://github.com/matthiask/plata/blob/master/plata/shop/forms.py#L111
The logic is contained in a form because it's much easier to replace forms than view code (which would not be that hard either).
— Reply to this email directly or view it on GitHubhttps://github.com/matthiask/plata/issues/22#issuecomment-11076790.
3D art, 2D art, web development - FelixSchlitter.com
Hi
Great to hear that you solved it!
Btw, this is the issue tracking an official implementation of something like that:
https://github.com/matthiask/plata/issues/19
Thanks, Matthias
... and shorten the checkout process by one step