templates/components/attributes/attribute-button.html.twig line 1

Open in your IDE?
  1. {% if atributos|default and atributo|default %}
  2.     <div id="{{ atributo }}" class="flex flex-col space-y-2 text-black">
  3.         <div class="text-sm font-light">
  4.             <div class="flex items-center gap-x-4">
  5.                 <span class="font-bold uppercase">{{ titulo|default ? titulo|raw : 'Selecciona ' ~ fn('wc_attribute_label', atributo)|raw }}</span>
  6.                 {% if modal|default %}
  7.                     <button data-modal-target="{{ modal }}"
  8.                             class="relative flex w-fit cursor-pointer select-none flex-row items-center gap-2 rounded-full border border-gray-400 px-2 py-0.5 text-xs group text-center hover:bg-black hover:bg-opacity-10 transition-all whitespace-nowrap"
  9.                             :class="{'hidden': !getAttributeImage('{{ atributo }}', current.attributes.attribute_{{ atributo }})}">
  10.                         {% include 'assets/info.svg' %}
  11.                         Ver detalles
  12.                     </button>
  13.                 {% endif %}
  14.             </div>
  15.         </div>
  16.         <div class="flex flex-row flex-wrap gap-2">
  17.             <template x-for="attribute in {{ atributos }} || []">
  18.                 <label :for="'{{ atributo }}_' + attribute"
  19.                        class="relative flex w-fit cursor-pointer select-none flex-row items-center gap-2 rounded-none border border-gray-300 px-3 py-1 text-xs bg-white has-[:disabled]:hidden transition-all"
  20.                        @click.stop="changeVariation('{{ atributo }}', attribute)">
  21.                     <span class="text-start text-sm font-bold"
  22.                           x-text="getAttributeName('{{ atributo }}', attribute)"></span>
  23.                     <input :id="'{{ atributo }}_' + attribute"
  24.                            class="absolute h-0 w-0 appearance-none opacity-0"
  25.                            type="radio" name="{{ atributo }}"
  26.                            :value="attribute"
  27.                            @click.stop
  28.                            :checked="isCurrentAttribute('{{ atributo }}', attribute)"
  29.                            :disabled="!variationExists('{{ atributo }}', attribute)"/>
  30.                     <span aria-hidden="true"
  31.                           class="outline-2 absolute inset-0 hidden rounded-none bg-black bg-opacity-10 outline outline-black"></span>
  32.                 </label>
  33.             </template>
  34.         </div>
  35.     </div>
  36. {% endif %}