Commits

Tay Ray Chuan  committed 1137efc

satchmo_order: add order_payment_methods filter

  • Participants
  • Parent commits 81d352a

Comments (0)

Files changed (1)

File satchmo/apps/satchmo_store/shop/templatetags/satchmo_order.py

 from django import template
+
+from livesettings import config_get_group
 from satchmo_utils.templatetags import get_filter_args
 
 register = template.Library()
 #     return None
 #
 # register.filter(giftcertificate)
+
+@register.filter
+def order_payment_methods(order):
+    """
+    Returns a list of payment method labels for an order.
+
+    Usage::
+
+      {{ order|order_payment_methods|join:", " }}
+
+    """
+    return (config_get_group('PAYMENT_%s' % p.payment).LABEL.value
+             for p in order.payments.all())