{% sw_extends '@Storefront/storefront/component/buy-widget/buy-widget-form.html.twig' %}
{% block buy_widget_buy_redirect_input %}
{% if context.customer %}
{# fallback redirect back to detail page is deactivated via js #}
<input type="hidden"
name="redirectTo"
value="frontend.detail.page">
<input type="hidden"
name="redirectParameters"
data-redirect-parameters="true"
value='{"productId": "{{ product.id }}"}'>
{% endif %}
{% endblock %}
{% block buy_widget_buy_product_buy_info %}
{% if context.customer %}
<input type="hidden"
name="lineItems[{{ product.id }}][id]"
value="{{ product.id }}">
<input type="hidden"
name="lineItems[{{ product.id }}][type]"
value="product">
<input type="hidden"
name="lineItems[{{ product.id }}][referencedId]"
value="{{ product.id }}">
<input type="hidden"
name="lineItems[{{ product.id }}][stackable]"
value="1">
<input type="hidden"
name="lineItems[{{ product.id }}][removable]"
value="1">
<input type="hidden"
name="lineItems[{{ product.id }}][unitPrice]"
value="{{ page.product.calculatedPrice.unitPrice }}">
{% endif %}
{% endblock %}
{% block buy_widget_product_buy_meta %}
{% if context.customer %}
<input type="hidden"
name="product-name"
value="{{ product.translated.name }}">
<input type="hidden"
name="brand-name"
value="{{ product.manufacturer.getName() }}">
{% endif %}
{% endblock %}
{% block buy_widget_buy_button %}
{% if context.customer %}
<button class="btn btn-primary btn-block btn-buy"
title="{{ "detail.addProduct"|trans|striptags }}"
aria-label="{{ "detail.addProduct"|trans|striptags }}">
{{ "detail.addProduct"|trans|sw_sanitize }}
</button>
{% elseif config('ProclaneWegmannTheme.config.activateContactForm') and config('ProclaneWegmannTheme.config.selectedCategoriesForContactForm') %}
{% set contactFormCategory = config('ProclaneWegmannTheme.config.selectedCategoriesForContactForm') %}
{% set productName = product.translated.name %}
{% set productNumber = product.productNumber %}
<a href="{{ seoUrl('frontend.navigation.page', { navigationId: contactFormCategory, 'productName': productName, 'productNumber': productNumber }) }}" title="" class="btn btn-primary btn-block btn-buy">
{{ "proclane-wegmann-theme.contactFormOnPDP"|trans|sw_sanitize }}
</a>
{% else %}
<a href="{{ path('frontend.account.login.page') }}" title="{{ "detail.addProductGuest"|trans|striptags }}" class="btn btn-primary btn-block btn-buy">
{{ "detail.addProductGuest"|trans|striptags }}
</a>
{% endif %}
{% endblock %}