{% sw_extends "@Storefront/storefront/page/product-detail/index.html.twig" %}
{% block page_product_detail_buy %}
{% set eventProductExtensionKey = constant('B2bEventManager\\Components\\Product\\Service\\EventProductExtensionService::PRODUCT_EVENT_EXTENSION') %}
<div class="col-lg-5 product-detail-buy">
{% sw_include '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
{% set followUpArticle = page.extensions.b2bFollowUpArticle %}
{% if b2bPlatformConfig.enableFollowUpArticle and page.product.isCloseout or b2bPlatformConfig.enableFollowUpArticle == false %}
{% if followUpArticle %}
{% block follow_up_article %}
<div class="follow-up-article">
{% block follow_up_article_title %}
<div class="title">
{{ "detail.followUpArticleTitle"|trans|sw_sanitize }}
</div>
{% endblock %}
{% block follow_up_article_content %}
<div class="follow-up-article-product">
<div class="row">
<div class="col-md-2">
{% block follow_up_article_media %}
{% if followUpArticle.cover.media.url %}
<a href="{{ seoUrl('frontend.detail.page', {'productId': followUpArticle.id}) }}"
title="{{ followUpArticle.translated.name }}">
<img class="follow-up-article-img"
src="{{ followUpArticle.cover.media.url }}"
alt="{{ followUpArticle.translated.name }}">
</a>
{% else %}
{% sw_icon 'placeholder' style {
'size': 'lg'
} %}
{% endif %}
{% endblock %}
</div>
<div class="col-md-10">
{% block follow_up_article_name %}
<a href="{{ seoUrl('frontend.detail.page', {'productId': followUpArticle.id}) }}"
class="title">
{{ followUpArticle.translated.name }}
</a>
{% endblock %}
{% block follow_up_article_product_number %}
{% if followUpArticle.productNumber %}
<div class="product-detail-ordernumber-container">
{% block follow_up_article_product_number_label %}
<span class="product-detail-ordernumber-label">{{ "detail.productNumberLabel"|trans|sw_sanitize }}</span>
{% endblock %}
{% block follow_up_article_number %}
<meta itemprop="productID"
content="{{ followUpArticle.id }}"/>
<span class="product-detail-ordernumber"
itemprop="sku">{{ followUpArticle.productNumber }}</span>
{% endblock %}
</div>
{% endif %}
{% endblock %}
{% block follow_up_article_price %}
{% if b2bPlatformConfig.disableProductPricesVisibility and not context.customer %}
{% block page_product_detail_login_to_buy_label %}
<div class="product-login-to-buy-label">
<i class="fa fa-info-circle"></i>{{ 'detail.loginToBuy'|trans|sw_sanitize }}
</div>
{% endblock %}
{% else %}
{% if b2b_show_prices() %}
{{ followUpArticle.calculatedPrice.unitPrice|currency }}
{% elseif not isEmployee %}
{{ followUpArticle.calculatedPrice.unitPrice|currency }}
{% endif %}
{% endif %}
{% endblock %}
</div>
</div>
</div>
{% endblock %}
</div>
{% endblock %}
{% endif %}
{% endif %}
</div>
{% endblock %}
{% block page_product_detail_content %}
{% set order = page.extensions.orderProductAlreadyBought %}
{% if order %}
<div class="product-already-bought">
<p class="product-already-bought-title">
{% sw_icon 'info' style {
'size': 'sm'
} %}
{{ "productDetail.productAlreadyBoughtText"|trans({'%orderAt%': order.createdAt|format_date('short', locale=locale)})|sw_sanitize }}
</p>
<div class="d-lg-flex">
{% if order.product.options %}
<p class="options">
{% for option in order.product.options %}
<span>{{ option.group }}: {{ option.option }}</span> |
{% endfor %}
</p>
{% endif %}
<a href="{{ path('frontend.b2b_platform.index') }}/order/?id={{ order.orderId }}"
title="{{ "account.ordersLink"|trans|striptags }}"
class="order-details">
{{ 'productDetail.showOrderDetails'|trans|sw_sanitize }}
</a>
</div>
</div>
{% endif %}
{{ parent() }}
{% endblock %}
{% block page_product_detail_tabs %}
{{ parent() }}
{% if b2b_feature_enabled('B2bPdpVariantList') %}
{% sw_include '@B2bSellersCore/storefront/page/product-detail/product-variante-info.html.twig' %}
{% endif %}
{% endblock %}