custom/static-plugins/NdVoorwindenTheme/src/Resources/views/storefront/page/product-detail/tap-bar.html.twig line 1

Open in your IDE?
  1. {% set product = page.product %}
  2. {% set count = 0 %}
  3. {% for element in page.product.children.elements %}
  4.     {% set count = count + element.stock %}
  5. {% endfor %}
  6. {% if count > 0 %}
  7.     <nav id="tap-bar" class="tap-bar-add-to-cart">
  8.         <div class="fixed bottom-0 left-0 right-0 py-3 lg:5 rounded-t-sm bg-white transition translate-y-full opacity-0 z-10 max-w-[1008px] mx-auto"
  9.              data-product-tab-bar="true"
  10.              data-toggle-classes="translate-y-0 opacity-100"
  11.              style="box-shadow: 0px -20px 25px -5px rgba(0, 0, 0, 0.1), 0px -10px 10px -5px rgba(0, 0, 0, 0.04);">
  12.             <div class="boxed-layout md:flex md:items-center md:grid-gap-8 md:justify-between lg:px-6">
  13.                 <div class="tab-bar-product-container hidden md:flex md:grid-gap-4 lg:grid-gap-8">
  14.                     <div class="product-thumbnail ratio ratio_product_image w-12">
  15.                         {% sw_thumbnails 'product-tab-bar-thumbnail' with {
  16.                             media: product.cover.media,
  17.                             attributes: {
  18.                                 'class': 'product-tab-bar-thumbnail',
  19.                                 'alt': (product.cover.media.translated.alt ?: ''),
  20.                                 'title': (product.cover.media.translated.title ?: '')
  21.                             }
  22.                         } %}
  23.                     </div>
  24.                     <div class="product-info flex flex-col justify-center">
  25.                         {# {% if product.manufacturer.translated.name %} #}
  26.                         {# <div class="product-brand-name font-accent font-bold uppercase text-sm line-clamp-1 mb-2"> #}
  27.                         {# {{ product.manufacturer.translated.name }} #}
  28.                         {# </div> #}
  29.                         {# {% endif %} #}
  30.                         {% block component_product_box_name %}
  31.                             <div class="product-name font-accent font-bold uppercase text-sm line-clamp-1">
  32.                                 {{ product.translated.name }}
  33.                             </div>
  34.                         {% endblock %}
  35.                         {% block component_product_box_price %}
  36.                             {% sw_include '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
  37.                         {% endblock %}
  38.                     </div>
  39.                 </div>
  40.                 <div class="tab-bar-atc-container md:flex-grow-1 md:justify-end {% if page.product.children|length > 0 %}flex items-center grid-gap-2 lg:grid-gap-8{% endif %}">
  41.                     {% set buyable = product.available and product.calculatedMaxPurchase > 0 %}
  42.                     {% if buyable %}
  43.                         {% if page.product.children|length > 0 %}
  44.                             <div class="w-1/3 flex-shrink-0 lg:w-[240px]">
  45.                                 {% sw_include '@Storefront/storefront/page/product-detail/configurator/select.html.twig' with{
  46.                                     'type': 'dropdown',
  47.                                     'position': 'top',
  48.                                     'label': false,
  49.                                     'tapBar': true,
  50.                                     'product': page.product
  51.                                 } %}
  52.                             </div>
  53.                         {% endif %}
  54.                     {% endif %}
  55.                     <button class="btn btn-primary w-full {% if buyable %}{% else %}pointer-events-none disabled{% endif %}"
  56.                             type="button"
  57.                             {% if buyable %}
  58.                                 title="{{ "tapBar.addToCart"|trans|striptags }}"
  59.                                 aria-label="{{ "tapBar.addToCart"|trans|striptags }}"
  60.                                 data-product-add-to-cart-button="true"
  61.                             {% endif %}
  62.                     >
  63.                         {% sw_icon 'cart-solid' style {'pack': 'hero', 'class': ' white w-5'} %}
  64.                         {% if buyable %}
  65.                             {{ "tapBar.addToCart"|trans|sw_sanitize }}
  66.                         {% else %}
  67.                             {{ "pages.product.soldOutLabel"|trans }}
  68.                         {% endif %}
  69.                     </button>
  70.                 </div>
  71.             </div>
  72.         </div>
  73.     </nav>
  74. {% endif %}