templates/frontend/components/smallProduct.html.twig line 1

Open in your IDE?
  1. {% trans_default_domain 'store' %}
  2. <!-- START OF ARTICLE -->
  3. <div class="column {% if isOneThird is defined and isOneThird == 1 %}
  4.             is-one-third-desktop is-one-third-tablet is-half-mobile
  5.         {% elseif isOneQuarter is defined and isOneQuarter == 1 %}
  6.             is-one-quarter-desktop is-one-quarter-tablet is-half-mobile
  7.         {% else %}is-half{% endif %}">
  8.     <div class="card {% if cssClass is defined and cssClass%}{{ cssClass }}{% endif%} {% if compareIds is defined and product.id in compareIds %} compare {% endif %}">
  9.         <span>
  10.             {% if (product.availability and product.availability.id == 1) or (product.availability and product.availability.id == 15 and app.request.locale == 'pl') or (product.availability and product.availability.id == 12 and app.request.locale == 'pl') or (product.availability and product.availability.id == 5) %}
  11.                 <div class="is-24h-product"></div>
  12.             {% elseif productData.isPromotion %}
  13.                 <div class="is-promotion-product"></div>
  14.             {% endif %}
  15.         </span>
  16.         <div class="{% if isOneThird is defined and isOneThird == 1 %}with-description{% else %}no-description{% endif %}">
  17.             <div class="card-image">
  18.                 <div class="image">
  19.                     {% if productData.subName is defined and productData.subName %}
  20.                         <a href="{{ path('product', {'id':product.id, 'slug':product.slug, 'sub':productData.subId}) }}">
  21.                     {% else %}
  22.                         <a href="{{ path('product', {'id':product.id, 'slug':product.slug}) }}">
  23.                     {% endif %}
  24.                     {% if lazyDisabled is defined and lazyDisabled %}
  25.                         <img data-main="{{ asset('/images/product/'~productData.mainPhoto~'') | imagine_filter('small') }}" src="{{ asset('/images/product/'~productData.mainPhoto~'') | imagine_filter('small') }}" alt="{{ product.name }}" class="img-responsive small-photo" />
  26.                     {% else %}
  27.                         <img data-main="{{ asset('/images/product/'~productData.mainPhoto~'') | imagine_filter('small') }}" src="/images/ajax-loader.gif" alt="{{ product.name }}" class="lazy img-responsive small-photo" data-src="{{ asset('/images/product/'~productData.mainPhoto~'') | imagine_filter('small') }}" />
  28.                     {% endif %}
  29.                     </a>
  30.                 </div>
  31.                 <div class="markers">
  32.                     {% if product.listingMarkersIds %}
  33.                         {% set listingImages = markerListingsProduct(product, app.request.locale) %}
  34.                         {% set c = 0 %}
  35.                         {% if listingImages is not empty %}
  36.                             {% set c = 0 %}
  37.                             {% for listingImage in listingImages %}
  38.                                 {% if listingImage.text %}
  39.                                     {% if listingImage.url %}
  40.                                         <a href="{{ listingImage.url }}">
  41.                                             <div class="listing-marker-element listing-marker-element-{{ c }}"
  42.                                                  style="background: {{ listingImage.backgroundColor }}; color: {{ listingImage.textColor }};">
  43.                                                 {{ listingImage.text }}
  44.                                             </div>
  45.                                         </a>
  46.                                         {% set c = c + 1 %}
  47.                                     {% else %}
  48.                                         <div class="listing-marker-element"
  49.                                              style="background: {{ listingImage.backgroundColor }}; color: {{ listingImage.textColor }};">
  50.                                             {{ listingImage.text }}
  51.                                         </div>
  52.                                     {% endif %}
  53.                                 {% endif %}
  54.                             {% endfor %}
  55.                         {% endif %}
  56.                     {% endif %}
  57.                 </div>
  58.             </div>
  59.             <div class="card-content">
  60.                 {% if productData.subName is defined and productData.subName %}
  61.                     <a class="cut-text" href="{{ path('product', {'id':product.id, 'slug':product.slug, 'sub':productData.subId}) }}">
  62.                         <span class="small-product-title">{{ productData.subName }}</span>
  63.                     </a>
  64.                 {% else %}
  65.                     <a class="cut-text" href="{{ path('product', {'id':product.id, 'slug':product.slug}) }}">
  66.                         <span class="small-product-title">{{ product.name }}</span>
  67.                     </a>
  68.                 {% endif %}
  69.                 <div class="title is-4">
  70.                     <div class="ta is-medium">
  71.                         {% if productData.priceCrossed is defined and productData.currencySign is defined and productData.priceCrossed %}
  72.                             <span style="color:#e22d2d">
  73.                         {% endif %}
  74.                         {% if productData.subPrice is defined and productData.subPrice %}
  75.                             <strong>{{ productData.subPrice|formatPrice(productData.currencyId) }}</strong>
  76.                         {% else %}
  77.                             <strong>{{ productData.priceDescription|formatPrice(productData.currencyId) }}</strong>
  78.                         {% endif %}
  79.                         {% if productData.priceCrossed is defined and productData.currencySign is defined and productData.priceCrossed %}
  80.                             </span>
  81.                         {% endif %}
  82.                         {% if productData.priceCrossed is defined and productData.currencySign is defined and productData.priceCrossed %}
  83.                             <br/>
  84.                             <span style="font-size: 14px!important; font-weight: 300!important;"><strike>{{ productData.priceCrossed|formatPrice(productData.currencyId) }}</strike></span>
  85.                         {% endif %}
  86.                     </div>
  87.                 </div>
  88.                 <div class="level is-mobile">
  89.                     <div class="level-left" style="margin-left:-5px;">
  90.                         {% if product.smallProductPhoto == constant('App\\Entity\\Product::SMALL_PRODUCT_PHOTO') %}
  91.                             {% set c = 0 %}
  92.                             {% for photo in getPhotos(product, language) %}
  93.                                 {% if c < 3 and photo.main != 1 and photo.imageName %}
  94.                                     {% set c = c + 1 %}
  95.                                     <div class="level-item color-thumb {% if c == 2 %}is-hidden-mobile{% endif %}">
  96.                                         <figure class="image">
  97.                                             <a href="{{ path('product', {'id':product.id, 'slug':product.slug}) }}">
  98.                                                 {% if lazyDisabled is defined and lazyDisabled %}
  99.                                                     <img src="{{ asset('/images/product/'~photo.imageName~'') | imagine_filter('textileBig4') }}">
  100.                                                 {% else %}
  101.                                                     <img src="/images/ajax-loader.gif" class="lazy" data-src="{{ asset('/images/product/'~photo.imageName~'') | imagine_filter('textileBig4') }}">
  102.                                                 {% endif %}
  103.                                             </a>
  104.                                         </figure>
  105.                                     </div>
  106.                                 {% endif %}
  107.                             {% endfor %}
  108.                         {% else %}
  109.                             {% set counter = 0 %}
  110.                             {% set c = 0 %}
  111.                             {% for value in product.getAllVariantValues() %}
  112.                                 {% set c = c + 1 %}
  113.                                 {% if c <= 3 %}
  114.                                     {% set counter = counter + 1 %}
  115.                                     {% if value.imageName %}
  116.                                         <div class="level-item color-thumb {% if c == 3 %}is-hidden-mobile{% endif %}">
  117.                                             <figure class="image">
  118.                                                 <a href="{{ path('product', {'id':product.id, 'slug':product.slug}) }}">
  119.                                                     <img class="lazy" data-src="{{ asset('/images/parameters/'~value.imageName~'') | imagine_filter('textileBig4') }}">
  120.                                                 </a>
  121.                                             </figure>
  122.                                         </div>
  123.                                     {% endif %}
  124.                                 {% endif %}
  125.                             {% endfor %}
  126.                             {% if counter %}
  127.                                 <!-- START OF MORE COLOURS / MATERIALS -->
  128.                                 <div class="level-item" style="margin-left:-10px;">
  129.                                         <span class="subtitle is-7">
  130.                                             {% if c > 3 %}
  131.                                                 <a href="#">+{{ c-3 }}</a>
  132.                                             {% endif %}
  133.                                         </span>
  134.                                 </div>
  135.                                 <!-- END OF MORE COLOURS / MATERIALS -->
  136.                             {% endif %}
  137.                         {% endif %}
  138.                     </div>
  139.                 </div>
  140.                 <div class="ta is-medium" style="{% if product.listingMarkersIds %}min-height: 85px;{% endif %}">
  141.                     {% if product.getShortDescriptionColor %}
  142.                         <div class="">
  143.                             <span class="subtitle is-7 short-description">
  144.                                 <span style="font-weight: normal">{{ 'colours'|trans }}:</span> <strong>{{ product.getShortDescriptionColor|striptags }}</strong>
  145.                                 </span>
  146.                         </div>
  147.                     {% endif %}
  148.                     {% if product.getShortDescriptionTextile %}
  149.                         <div class="is-hidden-mobile">
  150.                         <span class="subtitle is-7 short-description">
  151.                             <span style="font-weight: normal">{{ 'textile'|trans }}: </span>
  152.                                 <strong>{{ product.getShortDescriptionTextile|striptags }}</strong>
  153.                             </span>
  154.                         </div>
  155.                     {% endif %}
  156.                     <div>
  157.                     <span class="subtitle is-7 short-description">
  158.                         <span style="font-weight: normal">{{ 'shipping'|trans }}: </span> <strong>{{ product.getAvailability(language.localeShort).name }}</strong>
  159.                         </span>
  160.                     </div>
  161.                     {#
  162.                     {% if product.listingMarkersIds %}
  163.                         {% set listingImage = markerListingsProduct(product, app.request.locale) %}
  164.                         {% if listingImage %}
  165.                             {% if listingImage.url %}
  166.                                 <a href="{{ listingImage.url }}">
  167.                                         <span class="subtitle is-7">
  168.                                             <img class="listing-marker" src="/images/important/{{ listingImage.getImageName }}">
  169.                                         </span>
  170.                                 </a>
  171.                             {% else %}
  172.                                 <span class="subtitle is-7">
  173.                                         <img class="listing-marker" src="/images/important/{{ listingImage.getImageName }}">
  174.                                     </span>
  175.                             {% endif %}
  176.                         {% endif %}
  177.                     {% endif %}
  178.                     #}
  179.                 </div>
  180.             </div>
  181.             <div class="item-details is-hidden-touch" {% if lazyDisabled is defined and lazyDisabled %}style="display: none;" {% endif %}>
  182.                 <div class="container hidableContainer">
  183.                     {% if product.shortDescription %}
  184.                         <span class="subtitle is-7">
  185.                                 {{ product.shortDescription|raw }}
  186.                             </span>
  187.                         <br>
  188.                     {% endif %}
  189.                     {#
  190.                     <label {% if compareIds is defined and product.id in compareIds %}comparechecked{% endif %} @click="compareactive" class="checkbox" style="margin-top:5px;">
  191.                     #}
  192.                     <label class="checkbox" style="margin-top: 7px; font-size: 12px!important;">
  193.                         <input {% if compareIds is defined and product.id in compareIds %}
  194.                             checked="checked"
  195.                         {% endif %} type="checkbox" data-removepath="{{ path('remove_compare') }}" data-path="{{ path('add_to_compare') }}" class="add_to_compare" data-product="{{ product.id }}" id="{{ product.id }}">
  196.                         {{ 'add_to_compare'|trans }}
  197.                     </label>
  198.                 </div>
  199.             </div>
  200.         </div>
  201.     </div>
  202. </div>
  203. {#
  204. <chair-card inline-template {% if productData.isPromotion %}promotion{% endif %} {% if compareIds is defined and product.id in compareIds %}comparechecked{% endif %} v-cloak {% if (product.availability and product.availability.id == 1) or (product.availability and product.availability.id == 15 and app.request.locale == 'pl') or (product.availability and product.availability.id == 12 and app.request.locale == 'pl') or (product.availability and product.availability.id == 5) %}delivery24{% endif %}>
  205.     <div class="column
  206.         {% if isOneThird is defined and isOneThird == 1 %}
  207.             is-one-third
  208.         {% elseif isOneQuarter is defined and isOneQuarter == 1 %}
  209.             is-one-quarter
  210.         {% else %}is-half{% endif %}">
  211.         <div class="card" :class="{ 'compare': compare }">
  212.             <span v-if="!promotion">
  213.                 <div class="is-24h-product" v-if="delivery24"></div>
  214.             </span>
  215.             <div class="is-promotion-product" v-if="promotion"></div>
  216.             <div class="{% if isOneThird is defined and isOneThird == 1 %}with-description{% else %}no-description{% endif %}">
  217.                 <div class="card-image">
  218.                     <div class="image">
  219.                         {% if productData.subName is defined and productData.subName %}
  220.                             <a href="{{ path('product', {'id':product.id, 'slug':product.slug, 'sub':productData.subId}) }}">
  221.                         {% else %}
  222.                             <a href="{{ path('product', {'id':product.id, 'slug':product.slug}) }}">
  223.                         {% endif %}
  224.                             <img src="/images/ajax-loader.gif" alt="{{ product.name }}" class="lazy" data-src="{{ asset('/images/product/'~productData.mainPhoto~'') | imagine_filter('small') }}" class="img-responsive" />
  225.                         </a>
  226.                     </div>
  227.                 </div>
  228.                 <div class="card-content">
  229.                     {% if productData.subName is defined and productData.subName %}
  230.                         <a href="{{ path('product', {'id':product.id, 'slug':product.slug, 'sub':productData.subId}) }}">
  231.                             <span class="title is-6">{{ productData.subName }}</span>
  232.                         </a>
  233.                     {% else %}
  234.                         <a href="{{ path('product', {'id':product.id, 'slug':product.slug}) }}">
  235.                             <span class="title is-6">{{ product.name }}</span>
  236.                         </a>
  237.                     {% endif %}
  238.                     <div class="title is-4">
  239.                         <div class="ta is-medium">
  240.                             {% if productData.priceCrossed is defined and productData.currencySign is defined and productData.priceCrossed %}
  241.                                 <span style="color:#fe931f"><strong><strike>{{ productData.priceCrossed }} {{ productData.currencySign }}</strike></strong></span>
  242.                             {% endif %}
  243.                             {% if productData.subPrice is defined and productData.subPrice %}
  244.                                 <strong>{{ productData.subPrice|formatPrice(productData.currencyId) }}</strong>
  245.                             {% else %}
  246.                                 <strong>{{ productData.priceDescription|formatPrice(productData.currencyId) }}</strong>
  247.                             {% endif %}
  248.                         </div>
  249.                     </div>
  250.                     <div class="level is-mobile">
  251.                         <div class="level-left" style="margin-left:-5px;">
  252.                             {% if product.smallProductPhoto == constant('App\\Entity\\Product::SMALL_PRODUCT_PHOTO') %}
  253.                                 {% set c = 0 %}
  254.                                 {% for photo in getPhotos(product, language) %}
  255.                                     {% if c < 3 and photo.main != 1 and photo.imageName %}
  256.                                         {% set c = c + 1 %}
  257.                                         <div class="level-item color-thumb">
  258.                                             <figure class="image">
  259.                                                 <a href="{{ path('product', {'id':product.id, 'slug':product.slug}) }}">
  260.                                                     <img src="/images/ajax-loader.gif" class="lazy" data-src="{{ asset('/images/product/'~photo.imageName~'') | imagine_filter('textileBig4') }}">
  261.                                                 </a>
  262.                                             </figure>
  263.                                         </div>
  264.                                     {% endif %}
  265.                                 {% endfor %}
  266.                             {% else %}
  267.                                 {% set counter = 0 %}
  268.                                 {% set c = 0 %}
  269.                                 {% for value in product.getAllVariantValues() %}
  270.                                     {% set c = c + 1 %}
  271.                                     {% if c <= 3 %}
  272.                                         {% set counter = counter + 1 %}
  273.                                         {% if value.imageName %}
  274.                                             <div class="level-item color-thumb">
  275.                                                 <figure class="image">
  276.                                                     <a href="{{ path('product', {'id':product.id, 'slug':product.slug}) }}">
  277.                                                         <img class="lazy" data-src="{{ asset('/images/parameters/'~value.imageName~'') | imagine_filter('textileBig4') }}">
  278.                                                     </a>
  279.                                                 </figure>
  280.                                             </div>
  281.                                         {% endif %}
  282.                                     {% endif %}
  283.                                 {% endfor %}
  284.                                 {% if counter %}
  285.                                     <!-- START OF MORE COLOURS / MATERIALS -->
  286.                                     <div class="level-item" style="margin-left:-10px;">
  287.                                         <span class="subtitle is-7">
  288.                                             {% if c > 3 %}
  289.                                                 <a href="#">+{{ c-3 }}</a>
  290.                                             {% endif %}
  291.                                         </span>
  292.                                     </div>
  293.                                     <!-- END OF MORE COLOURS / MATERIALS -->
  294.                                 {% endif %}
  295.                             {% endif %}
  296.                         </div>
  297.                     </div>
  298.                     <div class="ta is-medium" style="{% if product.listingMarkersIds %}min-height: 85px;{% endif %}">
  299.                         {% if product.getShortDescriptionColor %}
  300.                             <span class="subtitle is-7 short-description">
  301.                                 {{ 'colours'|trans }}: <strong>{{ product.getShortDescriptionColor|striptags }}</strong>
  302.                             </span>
  303.                             <br>
  304.                         {% endif %}
  305.                         {% if product.getShortDescriptionTextile %}
  306.                             <span class="subtitle is-7 short-description">
  307.                                 {{ 'textile'|trans }}: <strong>{{ product.getShortDescriptionTextile|striptags }}</strong>
  308.                             </span>
  309.                             <br>
  310.                         {% endif %}
  311.                         <span class="subtitle is-7 short-description">
  312.                             {{ 'shipping'|trans }}: <strong>{{ product.getAvailability(language.localeShort).name }}</strong>
  313.                         </span>
  314.                         {% if product.listingMarkersIds %}
  315.                             {% set listingImage = markerListingsProduct(product, app.request.locale) %}
  316.                             {% if listingImage %}
  317.                                 {% if listingImage.url %}
  318.                                     <a href="{{ listingImage.url }}">
  319.                                         <span class="subtitle is-7">
  320.                                             <img class="listing-marker" src="/images/important/{{ listingImage.getImageName }}">
  321.                                         </span>
  322.                                     </a>
  323.                                 {% else %}
  324.                                     <span class="subtitle is-7">
  325.                                         <img class="listing-marker" src="/images/important/{{ listingImage.getImageName }}">
  326.                                     </span>
  327.                                 {% endif %}
  328.                             {% endif %}
  329.                         {% endif %}
  330.                     </div>
  331.                 </div>
  332.                 <div class="item-details">
  333.                     <div class="container hidableContainer">
  334.                         {% if product.shortDescription %}
  335.                             <span class="subtitle is-7">
  336.                                 {{ product.shortDescription|raw }}
  337.                             </span>
  338.                             <br>
  339.                         {% endif %}
  340.                         <label {% if compareIds is defined and product.id in compareIds %}comparechecked{% endif %} @click="compareactive" class="checkbox" style="margin-top:5px;">
  341.                             <input {% if compareIds is defined and product.id in compareIds %}
  342.                                 checked="checked"
  343.                             {% endif %} type="checkbox" v-model="compare" data-removepath="{{ path('remove_compare') }}" data-path="{{ path('add_to_compare') }}" class="add_to_compare" data-product="{{ product.id }}" id="{{ product.id }}">
  344.                             {{ 'add_to_compare'|trans }}
  345.                         </label>
  346.                     </div>
  347.                 </div>
  348.             </div>
  349.         </div>
  350.     </div>
  351. </chair-card>
  352. <!-- END OF ARTICLE -->
  353. #}