{% sw_extends '@Storefront/storefront/layout/header/actions/wishlist-widget.html.twig' %}
{# ThemeWare® HC-Architecture® via configuration #}
{# ---------------- START: SET TEMPLATE VARS ---------------- #}
{# ThemeWare: Set theme variables #}
{% set twtHeaderWishlistBtnCompatibility = theme_config('twt-header-wishlist-btn-compatibility') %}
{% set twtIconSet = theme_config('twt-iconset') %}
{# ---------------- END: SET TEMPLATE VARS ---------------- #}
{# ThemeWare: Changes on the wishlist-button #}
{# HC-Architecture @Doku #}
{% block layout_header_actions_wishlist_widget %}
{% if twtHeaderWishlistBtnCompatibility == 2 %}
{% set showCounter = showCounter ?? true %}
{# ThemeWare: Icon austauschen #}
{% if showCounter %}
<span class="header-wishlist-icon">
{% if twtIconSet is not same as ('default') %}
{% sw_icon 'heart' style {'pack':'themeware'} %}
{% else %}
{% sw_icon 'heart' %}
{% endif %}
</span>
{% endif %}
{# ThemeWare: Add label 'header-wishlist-name' #}
{% if showCounter %}
<span class="header-wishlist-name">
{{ "twt.header.wishlistText"|trans }}
</span>
{% endif %}
{% set wishlistStorageOptions = {
listPath: path('frontend.wishlist.product.list'),
mergePath: path('frontend.wishlist.product.merge'),
tokenMergePath: sw_csrf('frontend.wishlist.product.merge', {'mode': 'token'}),
pageletPath: path('frontend.wishlist.product.merge.pagelet'),
tokenPageletPath: sw_csrf('frontend.wishlist.product.merge.pagelet', {'mode': 'token'}),
} %}
{% set wishlistWidgetOptions = { showCounter: showCounter } %}
<span class="badge badge-primary header-wishlist-badge"
id="wishlist-basket"
data-wishlist-storage="true"
data-wishlist-storage-options="{{ wishlistStorageOptions|json_encode }}"
data-wishlist-widget="true"
data-wishlist-widget-options="{{ wishlistWidgetOptions|json_encode }}"
></span>
{% else %}
{# Default block #}
{{ parent() }}
{% endif %}
{% endblock %}