{% set oob='true' %}
{% import '_types/product/_cart.html' as _cart %}
{% from '_types/cart/_mini.html' import mini with context %}
{{mini()}}

{{ _cart.add(d.slug, cart,  oob='true')}}

{% from '_types/product/_cart.html' import cart_item with context %}

{% if cart | sum(attribute="quantity") > 0 %}
  {% if item.quantity > 0 %}
    {{ cart_item(oob='true')}}
  {% else %}
    {{ cart_item(oob='delete')}}
  {% endif %}
  {% from '_types/cart/_cart.html' import summary %}
  
  {{ summary(cart, total,calendar_total, calendar_cart_entries,  oob='true')}}

{% else %}
  {% set cart=[] %}
  {% from '_types/cart/_cart.html' import show_cart  with context %}
  {{ show_cart( oob='true') }}

{% endif %}