Commits

twidi committed 979d4ff

In the "product_upsell" templatetag, return a RequestContext, not only a simple context, to provide some context var like "sale" to calculate the price of upsell products

Comments (0)

Files changed (1)

satchmo/apps/satchmo_ext/upsell/templatetags/satchmo_upsell.py

 
 register = template.Library()
 
-def product_upsell(product):
+def product_upsell(context, product):
     """
     Display the list of products that are upsell candidates for currently viewed product.
     """
     goals = None
     if product.upselltargets.count() > 0:
         goals = product.upselltargets.all()
-        
-    return { 'goals' : goals }
-register.inclusion_tag("upsell/product_upsell.html", takes_context=False)(product_upsell)
+
+    return template.RequestContext(context['request'], { 'goals' : goals })
+register.inclusion_tag("upsell/product_upsell.html", takes_context=True)(product_upsell)