templates/template-parts/price-nav-fixed.html.twig line 1

Open in your IDE?
  1. {% if product.regular_price|default or product.sale_price|default %}
  2.     <template x-if="currentIsInStock()">
  3.         <section id="fixedNavPrice"
  4.                  class="w-full fixed bottom-0 left-0 right-0 bg-gray-100 shadow-[0_1px_13px_0px_rgba(0,0,0,0.1)] z-10 ease-in-out duration-500">
  5.             <div class="mx-auto max-w-screen-2xl flex flex-col md:flex-row gap-0 md:gap-4 md:px-5 lg:px-20">
  6.                 <div class="flex flex-col md:flex-row md:w-full justify-between md:justify-start md:items-center md:gap-2 px-4 pb-4 md:py-3 md:px-0">
  7.                     <span class="text-black md:text-2xl lg:min-w-fit py-1">{{ product.name }}</span>
  8.                     <div class="flex flex-row justify-between items-end md:items-center w-full gap-4">
  9.                         {% if totalPrice|default %}
  10.                             <div>
  11.                             <span class="text-xl text-black font-bold"
  12.                                   x-text="currentVariationTotalPrice()">{{ product.regular_price|number_format(2,',','.')|replace({',00':''}) ~ '€' }}</span>
  13.                                 <span x-text="'(' + amount + 'm)'">(1m)</span>
  14.                             </div>
  15.                         {% elseif product.regular_price|default and product.sale_price|default %}
  16.                             <div class="flex flex-row md:flex-row-reverse items-end md:gap-2">
  17.                                 <span class="text-xs md:text-sm text-[#A3A3A3] line-through pr-1"
  18.                                       x-text="currentVariationRegularPrice()">{{ product.regular_price|number_format(2,',','.')|replace({',00':''}) ~ '€' }}</span>
  19.                                 <span class="text-xl text-black font-bold"
  20.                                       x-text="currentVariationSalePrice()">{{ product.sale_price|number_format(2,',','.')|replace({',00':''}) ~ '€' }}</span>
  21.                             </div>
  22.                         {% else %}
  23.                             <span class="text-xl text-black font-bold"
  24.                                   x-text="currentVariationRegularPrice('{{ afterPrice|default }}')">{{ product.regular_price|number_format(2,',','.')|replace({',00':''}) ~ '€' ~ afterPrice|default }}</span>
  25.                         {% endif %}
  26.                         <button id="addToCartFixed"
  27.                                 data-redirect-to-cart="{{ cart_url }}"
  28.                                 class="single_add_to_cart_button w-full max-w-[300px] h-fit flex flex-row justify-center items-center gap-3 rounded-none bg-primary p-2 text-white text-center"
  29.                                 @click="addToCart()">
  30.                             <svg id="loading_buy_fixed" class="hidden animate-spin h-5 w-5 text-white"
  31.                                  xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
  32.                                 <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor"
  33.                                         stroke-width="4"></circle>
  34.                                 <path class="opacity-75" fill="currentColor"
  35.                                       d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
  36.                             </svg>
  37.                             <span id="loading_buy_text_fixed">Añadir a la cesta</span>
  38.                         </button>
  39.                     </div>
  40.                 </div>
  41.             </div>
  42.         </section>
  43.     </template>
  44. {% endif %}