{% sw_extends '@Storefront/storefront/layout/header/header.html.twig' %}
{% block layout_top_bar %}
{% block layout_top_bar_b2b_top_bar %}
{% sw_include '@B2bSellersCore/storefront/layout/header/actions/topbar-widget.html.twig' %}
{% endblock %}
{{ parent() }}
{% endblock %}
{% block layout_header_search_toggle %}
{{ parent() }}
{% if not isSalesRepresentative %}
{% block layout_header_actions_consumer_view %}
{% if b2bPlatformConfig.enableConsumerView and context.customer %}
{% sw_include '@B2bSellersCore/storefront/layout/header/actions/consumer-view-widget.html.twig' %}
{% endif %}
{% endblock %}
{% endif %}
{% if not isSalesRepresentative %}
{% block layout_header_actions_fastorder %}
{% sw_include '@B2bSellersCore/storefront/layout/header/actions/fast-order-widget.html.twig' %}
{% endblock %}
{% endif %}
{% endblock %}
{% block layout_header_actions_cart %}
{% set isCartEnabled = (not isSalesRepresentative or loggedInAsCustomer) and (not b2bPlatformConfig.closedShop or context.customer) %}
{% set hasCartPermission = not context.extensions.b2bPlatformContext or employee_permission(['order']) %}
{% if isCartEnabled and hasCartPermission %}
{% if b2bPlatformConfig.disableProductPricesVisibility and not context.customer %}
{% block layout_header_actions_cart_redirect %}
<div class="col-auto">
<div class="header-cart">
{% block layout_header_actions_cart_redirect_link %}
<a class="btn header-cart-btn header-actions-btn"
href="{{ path('frontend.account.login.page') }}"
data-cart-widget="true"
title="{{ 'detail.loginToBuy'|trans|sw_sanitize }}"
aria-label="{{ 'detail.loginToBuy'|trans|sw_sanitize }}">
{% sw_include '@Storefront/storefront/layout/header/actions/cart-widget.html.twig' %}
</a>
{% endblock %}
</div>
</div>
{% endblock %}
{% else %}
{{ parent() }}
{% endif %}
{% endif %}
{% endblock %}
{% block layout_header_search %}
{% set hasListingPermission = not context.extensions.b2bPlatformContext or employee_permission(['viewListing']) %}
{% if b2bPlatformConfig.closedShop and not context.customer or not hasListingPermission %}
{% block layout_header_search_disabled %}
<div class="col-12 order-2 col-sm order-sm-1 header-search-col"></div>
{% endblock %}
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block layout_header_actions_account %}
{% if b2b_feature_enabled('B2bProductLists') %}
{% block layout_header_actions_product_lists %}
{% if b2bProductListConfig.showProductListsFunction %}
{% sw_include '@B2bSellersCore/storefront/layout/header/actions/product-list-widget.html.twig' %}
{% endif %}
{% endblock %}
{% endif %}
{{ parent() }}
{% endblock %}