{% sw_extends '@Storefront/storefront/layout/header/actions/cart-widget.html.twig' %}
{% block layout_header_actions_cart_widget %}
{% set selectedPriceState=app.request.cookies.get('dmits-bruttonetto-cookie-value') %}
{% if (selectedPriceState=='') and (app.request.get('showprice'))%}
{% set selectedPriceState=app.request.get('showprice')%}
{% endif %}
{% if (selectedPriceState=='') and (app.session.get('dmits-bruttonetto-selectedPriceState'))%}
{% set selectedPriceState=app.session.get('dmits-bruttonetto-selectedPriceState')%}
{% endif %}
<span class="header-cart-icon">
{% sw_icon 'bag' %}
</span>
{% if page.cart.lineItems|length > 0 %}
<span class="badge badge-primary header-cart-badge">{{ page.cart.lineItems|length }}</span>
{% endif %}
<span class="header-cart-total">
{% if ((selectedPriceState==context.taxState) or (selectedPriceState=='') or (app.session.get('dmits-bruttonetto-page')=='checkout')) %}
{{ page.cart.price.positionPrice|currency }}
{% elseif selectedPriceState=='net' %}
{{ page.cart.price.netPrice|currency }}
{% else %}
{{ page.cart.price.totalPrice|currency }}
{% endif %}{{ "general.star"|trans|sw_sanitize }}
</span>
{% endblock %}