{% block zenit_floating_buybox %}
{% set groupsToggleContainerClasses = 'col-auto' %}
{% set priceContainerClasses = 'col-auto' %}
{% set descriptionContainerClasses = 'col' %}
{% set formContainerClasses = 'col-12 col-md-auto' %}
{% if config('zenitAppFloatingBuybox.config.showPrice') and config('zenitAppFloatingBuybox.config.showConfigurator') %}
{% set groupsToggleContainerClasses = 'col col-sm' %}
{% set priceContainerClasses = 'col col-sm-auto' %}
{% set descriptionContainerClasses = 'col-6 col-sm-auto' %}
{% set formContainerClasses = 'col-12 col-md-auto' %}
{% endif %}
{% if customizedProductsTemplate is null %}
{% if config('zenitAppFloatingBuybox.config.active') and page.product.translated.customFields.zenit_floating_buybox_hidden is not same as (true) %}
{% if not (page.product.parentId and page.configuratorSettings|length > 0) or page.product.parentId and page.configuratorSettings|length > 0 and config('zenitAppFloatingBuybox.config.showOnVariants') %}
{# ... js config #}
{% set floatingBuxboxOptions = {
viewports: config('zenitAppFloatingBuybox.config.statemanager') ? config('zenitAppFloatingBuybox.config.statemanager') : ['XS', 'SM', 'MD', 'LG', 'XL'],
offsetTop: config('zenitAppFloatingBuybox.config.offsetTop'),
offsetBottom: config('zenitAppFloatingBuybox.config.offsetBottom'),
scrollUpButtonHidden: config('zenitAppFloatingBuybox.config.scrollUpButtonHidden')
} %}
{# ... prices #}
{% set price = page.product.calculatedPrice %}
{% if page.product.calculatedPrices|length == 1 %}
{% set price = page.product.calculatedPrices.first %}
{% endif %}
{% block zenit_floating_buybox_container %}
<div class="buybox-floating js-hidden" data-floating-buybox="true" data-zen-app-floating-buybox-options="{{ floatingBuxboxOptions|json_encode }}">
{% block zenit_floating_buybox_inner %}
<div class="buybox-floating-inner" data-floating-buybox-collapse="true">
<div class="container{% if not config('zenitAppFloatingBuybox.config.innerContainer') %}-fluid{% endif %}">
{% block zenit_floating_buybox_configurator %}
{% if page.product.parentId and page.configuratorSettings|length > 0 and config('zenitAppFloatingBuybox.config.showConfigurator') and page.product.translated.customFields.zenit_floating_variant_configuration_hidden is not same as (true) %}
{% sw_include '@Storefront/storefront/zenit-floating-buybox/floating-buybox-configurator.html.twig' %}
{% endif %}
{% endblock %}
<div class="row mx-n1 mx-lg-n2 justify-content-center">
{% if page.product.parentId and page.configuratorSettings|length > 0 and config('zenitAppFloatingBuybox.config.showConfigurator') and page.product.translated.customFields.zenit_floating_variant_configuration_hidden is not same as (true) %}
<div class="product-detail-configurator-groups-toggle-container px-1 px-lg-2 {{ groupsToggleContainerClasses }}" data-floating-buybox-toggler="true">
{% sw_include '@Storefront/storefront/zenit-floating-buybox/floating-buybox-configurator-groups-toggle.html.twig' %}
</div>
{% endif %}
{% block zenit_floating_buybox_price %}
{% if config('zenitAppFloatingBuybox.config.showPrice') %}
<div class="product-detail-price-container px-1 px-lg-2 {{ priceContainerClasses }}">
{% if page.product.calculatedPrices|length <= 1 %}
{% if cms %}
{{ block('buy_widget_price_content', '@Storefront/storefront/component/buy-widget/buy-widget-price.html.twig') }}
{% else %}
{{ block('page_product_detail_price_content', '@Storefront/storefront/page/product-detail/buy-widget-price.html.twig') }}
{% endif %}
{% endif %}
</div>
{% endif %}
{% endblock %}
{% block zenit_floating_buybox_description %}
{% if config('zenitAppFloatingBuybox.config.showTitle') or config('zenitAppFloatingBuybox.config.showPurchaseunit') %}
<div class="product-detail-name-container px-1 px-lg-2{% if config('zenitAppFloatingBuybox.config.showPurchaseunit') %} has-purchase-unit{% endif %} {{ descriptionContainerClasses }}">
{% block zenit_floating_buybox_name %}
{% if config('zenitAppFloatingBuybox.config.showTitle') %}
<h6 class="product-detail-name"
itemprop="name">
{{ page.product.translated.name }}
</h6>
{% endif %}
{% endblock %}
{% block zenit_floating_buybox_purchaseUnit %}
{% if config('zenitAppFloatingBuybox.config.showPurchaseunit') %}
{% if page.product.purchaseUnit %}
{% if cms %}
{{ block('buy_widget_price_unit', '@Storefront/storefront/component/buy-widget/buy-widget-price.html.twig') }}
{% else %}
{{ block('page_product_detail_price_unit', '@Storefront/storefront/page/product-detail/buy-widget-price.html.twig') }}
{% endif %}
{% endif %}
{% endif %}
{% endblock %}
</div>
{% endif %}
{% endblock %}
{% block zenit_floating_buybox_form %}
<div class="product-detail-form-container px-1 px-lg-2 {{ formContainerClasses }}">
{% sw_include '@Storefront/storefront/' ~ path ~ 'buy-widget-form.html.twig' with {
floatingBuyboxId: 'Floating'
} %}
</div>
{% endblock %}
</div>
</div>
</div>
{% endblock %}
</div>
{% endblock %}
{% endif %}
{% endif %}
{% endif %}
{% endblock %}