You probably want to use
{{ product|untaxed_sale_price|currency }}
where "untaxed_sale_price" internally calls "find_best_auto_discount"
for the product.
All three filters:
discount_price, taxed_discount_price, untaxed_discount_price
are useful _only_ if you want to give a discount for all products to
some users or on some day and you should combine them with signals
from checkout, to be consistent. Autodiscounts are cleaner.
It is related to discussion about the following problem and to
resolution that global context variable "sale" has been renamed to
"storewide_sale".
https://bitbucket.org/chris1610/satchmo/issue/1171/satchmo_storeshopcontext_processorssetting
Oliver, is your example really useful?
If "find_best_auto_discount" is applied to a set, it should be
carefully.
Example: You have two products A B with autodiscounts.
A, $1000, 10%
B, $10, 75%
Is really 75% the best you want for both??
find_best_auto_discount([A, B]) yes you see big fat printed 75%
today, but really?
The most interesting proposals to discounts are in "discounts
brainstorming"
issues #1351, #1352, #1381 (probably much more than is desirable)
--Hy
On 28 bře, 10:24, Olivier Lauret <[email protected]>
wrote:
> Hi,
>
> I had this problem as well. It is related, as you probably realised, to the
> sale key which is not part of your Request Context. I found a solution but
> it is at the moment very inefficient. Maybe, someone else can help with
> something better.
>
> Here is what I have done:
>
> *******************************************************************
> from product.utils import find_best_auto_discount
>
> def shop(request, template="shop/shop_base.html"):
> [...]
> Prod = Product.objects.all()
> [...]
> best_discount = find_best_auto_discount(list(Prod))
>
> myDict = {
> 'all_products_list' : page.object_list,
> 'is_paginated' : is_paged,
> 'page_obj' : page,
> 'paginator' : paginator,
> 'sale' : best_discount,
> }
> ctx=RequestContext(request, myDict)
> return render_to_response(template, context_instance=ctx)
> *******************************************************************
>
> Hope this helps.
> Regards,
> Olivier
>
> Le 27 mars 2012 22:10, easypie <[email protected]> a écrit :
>
>
>
>
>
>
>
> > sure. here's the error: dpaste.com/722438/
>
> > On Tuesday, March 27, 2012 1:52:30 PM UTC-7, olauret wrote:
>
> >> Can you share with us the error message?
>
> >> This might give us a hint.
> >> On Mar 27, 2012 9:27 PM, "easypie" <[email protected]> wrote:
>
> >>> Why does {{ product|discount_price:sale|**currency }} return an error
> >>> in shop/index.html template? I wanted the product thumbnail to also
> >>> include
> >>> the price listed below it. But there is an error?
>
> >>> here's a link to the template: dpaste.com/722410
>
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Satchmo users" group.
> >>> To view this discussion on the web visithttps://groups.google.com/d/**
> >>> msg/satchmo-users/-/**E29WNHCJgxYJ<https://groups.google.com/d/msg/satchmo-users/-/E29WNHCJgxYJ>
> >>> .
> >>> To post to this group, send email to [email protected]**.
> >>> To unsubscribe from this group, send email to satchmo-users+unsubscribe@
> >>> **googlegroups.com <satchmo-users%[email protected]>.
> >>> For more options, visit this group athttp://groups.google.com/**
> >>> group/satchmo-users?hl=en<http://groups.google.com/group/satchmo-users?hl=en>
> >>> .
>
> >> --
> > You received this message because you are subscribed to the Google Groups
> > "Satchmo users" group.
> > To view this discussion on the web visit
> >https://groups.google.com/d/msg/satchmo-users/-/uVJa8t2TGtEJ.
>
> > 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/satchmo-users?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Satchmo users" 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/satchmo-users?hl=en.