1. Chris Moffitt
  2. satchmo


Tay Ray Chuan  committed 56c341b

cart.html: use {% if not cart|length %}

This references #1015, which introduces Cart.is_empty(). However,
NullCarts don't implement this, so the cart template incorrectly
displays the non-empty cart portion.

Instead of defining is_empty() on NullCart, we instead use cart|length
in the template.

This fixes #1158.

Note: the {% if not foo|length %} syntax works since django 1.0.

  • Participants
  • Parent commits eca9280
  • Branches default

Comments (0)

Files changed (1)

File satchmo/apps/satchmo_store/shop/templates/shop/cart.html

View file
 {% if error_message %}
 <div class="error">{{ error_message }}</div>
 {% endif %}
-{% if cart.is_empty %}
+{% if not cart|length %}
     <h4>{% trans "Your cart is empty." %}</h4>
 {% else %}
     <h4>{% trans "Your Cart" %}</h4>