stack/src/components/items/product-variant-item/product-variant-item.twig line 1

Open in your IDE?
  1. {%- set class_name = [
  2.   "i-product-variant",
  3.   "d-flex flex-column justify-content-center",
  4.   "px-1 u-posr w-100",
  5.   props.extra_class|default(false) ? props.extra_class : null,
  6. ]|join(' ')|trim -%}
  7. {%- set attrs = [
  8.   'class="' ~ class_name ~ '"',
  9. ] -%}
  10. {% if props.id %}
  11.   {%- set attrs = attrs|merge(['id="' ~ props.id ~ '"']) -%}
  12. {% endif %}
  13. {%- set attrs = attrs|join(' ')|trim -%}
  14. {% set open_btn = {
  15.   title: "Otevřít variant"|trans,
  16.   tag: "button",
  17.   type: "button",
  18.   size: "sm",
  19.   icon_only: true,
  20.   icon: {
  21.     src: "@Images/svg/chevron-down.svg",
  22.     size: "lg"
  23.   },
  24.   extra_class: "--js-open-variant"
  25. } %}
  26. <div {{ attrs|raw }}>
  27.   {% if props.header %}
  28.     <ul class="i-product-variant__header d-grid align-items-center gap-1 flex-grow-1 u-cursor-pointer">
  29.       {% for item in props.header %}
  30.         {% if item %}
  31.           <li class="i-product-variant__header-item u-fz-sm u-fw-600 u-color-primary p-1">{{ item|raw|escape }}</li>
  32.         {% else %}
  33.           <li class="i-product-variant__header-item u-fz-sm u-fw-600 u-color-primary p-1">{{ "-" }}</li>
  34.         {% endif %}
  35.       {% endfor %}
  36.       {% include "@Components/button/button.twig" with {props: open_btn} %}
  37.     </ul>
  38.   {% endif %}
  39.   <div class="i-product-variant__body d-grid u-bg-white">
  40.     <div class="i-product-variant__body-inner overflow-hidden">
  41.       <div class="i-product-variant__content d-flex flex-column gap-5">
  42.         {% include "@Components/items/product-variant-item/product-variant-item--raw.twig" with {props: props} %}
  43.       </div>
  44.     </div>
  45.   </div>
  46. </div>