add rough euro prices to the shop. fix #32

This commit is contained in:
Stephan Telling 2017-03-26 13:57:00 +02:00
parent 850de5554f
commit 079ea6b2b8
No known key found for this signature in database
GPG key ID: D4892289F36ADA9B
4 changed files with 14 additions and 3 deletions

View file

@ -62,7 +62,8 @@
<td> <td>
<strong>Total</strong> <strong>Total</strong>
<td> <td>
{{ order.total|currency }} {{ order.total|currency }}<br />
(~{{ order.total|approxeur }})
</table> </table>

View file

@ -20,7 +20,8 @@
<h3> <h3>
<small>Price</small><br /> <small>Price</small><br />
{{ product.price|currency }} {{ product.price|currency }}<br />
~{{ product.price|approxeur }}
</h3> </h3>
<hr /> <hr />

View file

@ -57,7 +57,7 @@ Shop | {{ block.super }}
</td> </td>
<td> <td>
<div class="pull-right"> <div class="pull-right">
{{ product.price|currency }} {{ product.price|currency }} (~{{ product.price|approxeur }})
</div> </div>
</td> </td>
</tr> </tr>

View file

@ -13,6 +13,15 @@ def currency(value):
return False return False
@register.filter
def approxeur(value):
print(type(value))
try:
return "{0:.2f} EUR".format(value / Decimal(7.5))
except ValueError:
return False
@register.filter() @register.filter()
def truefalseicon(value): def truefalseicon(value):
if value: if value: