diff --git a/shuup_megastore_theme/static_src/less/shuup_megastore_theme/basket.less b/shuup_megastore_theme/static_src/less/shuup_megastore_theme/basket.less index 118e651..0d31098 100644 --- a/shuup_megastore_theme/static_src/less/shuup_megastore_theme/basket.less +++ b/shuup_megastore_theme/static_src/less/shuup_megastore_theme/basket.less @@ -42,3 +42,7 @@ padding-right: 5px; } } + +.basket-unorderable-lines { + margin-top: 50px; +} diff --git a/shuup_megastore_theme/templates/shuup_megastore_theme/shuup/front/macros/theme/basket.jinja b/shuup_megastore_theme/templates/shuup_megastore_theme/shuup/front/macros/theme/basket.jinja index 92a3e13..91a0916 100644 --- a/shuup_megastore_theme/templates/shuup_megastore_theme/shuup/front/macros/theme/basket.jinja +++ b/shuup_megastore_theme/templates/shuup_megastore_theme/shuup/front/macros/theme/basket.jinja @@ -3,15 +3,78 @@
{% csrf_token %} - {{ render_basket_lines() }} + + {{ render_basket_lines() }} + {{ render_unorderable_basket_lines() }} +
{{ render_coupon_div() }} {% endmacro %} -{% macro render_basket_lines() %} -
-
+{% macro _render_basket_line(line) %} + {% set product = line.product %} + + + {% if product %} + {% set image = product.primary_image %} + {% if image %} + + {{ line.name }} + + {% else %} + + {% endif %} + {% endif %} + + + {% if product %} + {{ line.text }} + {% else %} + {{ line.text }} + {% endif %} + + + {{ line.discounted_unit_price|money }} + {% if line.is_discounted %} + + {{ line.base_unit_price|money }} + + {% endif %} + + + {% if product and line.can_change_quantity %} + + {% endif %} + + + {{ line.price|money }} + + + {% if line.can_delete %} + + {% endif %} + + +{% endmacro %} + +{% macro _render_basket_lines(lines, orderable) %} + {% if lines %} +
{% csrf_token %} @@ -25,6 +88,7 @@ + {% if orderable %} + {% endif %} - {% for line in basket.get_final_lines() %} - {% set product = line.product %} - - - - - - - - + {% for line in lines %} + {{ _render_basket_line(line) }} {% endfor %}
@@ -39,68 +103,32 @@
- {% if product %} - {% set image = product.primary_image %} - {% if image %} - - {{ line.name }} - - {% else %} - - {% endif %} - {% endif %} - - {% if product %} - {{ line.text }} - {% else %} - {{ line.text }} - {% endif %} - - {{ line.discounted_unit_price|money }} - {% if line.is_discounted %} - - {{ line.base_unit_price|money }} - - {% endif %} - - {% if product and line.can_change_quantity %} - - {% endif %} - - {{ line.price|money }} - - {% if line.can_delete %} - - {% endif %} -
- -
+
+ {% endif %} +{% endmacro %} + +{% macro render_basket_lines() %} + {% set lines = basket.get_final_lines() %} + {% if lines %} +
+ {{ _render_basket_lines(lines, True) }} +
+ {% endif %} +{% endmacro %} + +{% macro render_unorderable_basket_lines() %} + {% set unorderable_lines = basket.get_unorderable_lines() %} + {% if unorderable_lines %} +
+

{% trans %}The following items are not currently available (or are not available in the desired quantity) and cannot be included in your order.{% endtrans %}

+ {{ _render_basket_lines(unorderable_lines, False) }} +
+ {% endif %} {% endmacro %}