{% sw_extends '@Storefront/storefront/page/account/sidebar.html.twig' %}
{% block page_account_sidebar_menu %}
{% if context.customer %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block page_account_sidebar_menu_inner %}
{% if not context.customer.customFields.b2b_sales_representative %}
{{ parent() }}
{% else %}
<a href="{{ path('frontend.b2b_platform.index') }}"
title="{{ "b2bPlatform.menuItems.dashboard"|trans|striptags }}"
class="list-group-item list-group-item-action account-aside-item">
{{ "b2bPlatform.menuItems.dashboard"|trans|sw_sanitize }}
</a>
{% endif %}
{% if b2b_feature_enabled('B2bProductLists') %}
{% if not isSalesRepresentative %}
{% block page_account_sidebar_link_product_list %}
{% if b2bProductListConfig.showProductListsFunction %}
{% if context.extensions.b2bPlatformContext is defined %}
<a href="{{ path('frontend.b2b_platform.path', {path: 'product-list'}) }}"
title="{{ "b2bProductList.account.productListLink"|trans|striptags }}"
class="list-group-item list-group-item-action account-aside-item">
{{ "b2bProductList.account.productListLink"|trans|sw_sanitize }}
</a>
{% else %}
<a href="{{ path('frontend.product-list.overview') }}"
title="{{ "b2bProductList.account.productListLink"|trans|striptags }}"
class="list-group-item list-group-item-action account-aside-item">
{{ "b2bProductList.account.productListLink"|trans|sw_sanitize }}
</a>
{% endif %}
{% endif %}
{% endblock %}
{% endif %}
{% endif %}
{% block page_account_sidebar_link_payment %}
<a href="{{ path('frontend.b2b_platform.path', {path: 'payment-methods'}) }}"
title="{{ "account.paymentLink"|trans|striptags }}"
class="list-group-item list-group-item-action account-aside-item{% if activeRoute is same as('frontend.account.payment.page') %} is-active{% endif %}">
{{ "account.paymentLink"|trans|sw_sanitize }}
</a>
{% endblock %}
{% endblock %}
{% block page_account_sidebar_link_home %}
{% if context.customer and context.customer.customFields.b2b_platform_access %}
<a href="{{ path('frontend.b2b_platform.index') }}"
title="{{ "b2bPlatform.menuItems.dashboard"|trans|striptags }}"
class="list-group-item list-group-item-action account-aside-item">
{{ "b2bPlatform.menuItems.dashboard"|trans|sw_sanitize }}
</a>
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block page_account_sidebar_link_profile %}
{% if context.customer and context.customer.customFields.b2b_platform_access %}
{% set employee = context.extensions.b2bPlatformContext.employee %}
<a href="{{ path('frontend.b2b_platform.path', {path: 'account'}) }}"
title="{{ "account.profileLink"|trans|striptags }}"
class="list-group-item list-group-item-action account-aside-item">
{{ "account.profileLink"|trans|sw_sanitize }}
</a>
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block page_account_sidebar_link_orders %}
{% if context.customer and context.customer.customFields.b2b_platform_access %}
{% block page_account_sidebar_link_b2b_order %}
<a href="{{ path('frontend.b2b_platform.index') }}/order"
title="{{ "account.ordersLink"|trans|striptags }}"
class="list-group-item list-group-item-action account-aside-item">
{{ "account.ordersLink"|trans|sw_sanitize }}
</a>
{% endblock %}
{% block page_account_sidebar_link_b2b_fastorder %}
{% if context.customer and context.customer.customFields.b2b_platform_access %}
<a href="{{ path('frontend.b2b_platform.index') }}/fast-order"
title="{{ "b2bPlatform.menuItems.fastOrder"|trans|striptags }}"
class="list-group-item list-group-item-action account-aside-item">
{{ "b2bPlatform.menuItems.fastOrder"|trans|sw_sanitize }}
</a>
{% endif %}
{% endblock %}
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block page_account_sidebar_link_address %}
{% if context.customer and context.customer.customFields.b2b_platform_access %}
<a href="{{ path('frontend.b2b_platform.index') }}/address"
title="{{ "account.addressLink"|trans|striptags }}"
class="list-group-item list-group-item-action account-aside-item">
{{ "account.addressLink"|trans|sw_sanitize }}
</a>
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block page_account_sidebar_logout %}
{% if context.extensions.b2bPlatformContext and b2b_feature_enabled('B2bBonusProgram') %}
{% set customer = context.customer %}
{% if employee_permission(['viewBonus']) and customer.customFields.b2b_bonus_enabled %}
<div class="card-footer b2b-bonus-container">
{% block page_account_sidebar_bonus %}
<div
class="btn btn-link account-aside-btn">
{% sw_icon 'medal' %}
<span class="b2b-bonus-label">{{ "b2bBonusProgram.header.account.myBonus" |trans|sw_sanitize }}: </span>
<span class="b2b-bonus-value">{{ customer.customFields.b2b_current_bonus |currency }}</span>
</div>
{% endblock %}
</div>
{% endif %}
{% endif %}
{{ parent() }}
{% endblock %}