custom/plugins/ThemeOkeonline/src/Resources/views/storefront/component/product/card/versions/version-02/box-standard.html.twig line 1

Open in your IDE?
  1. {% extends '@Storefront/storefront/component/product/card/box-standard.html.twig' %}
  2. {% block component_product_box %}
  3.     {% if product %}
  4.         {% set name = product.translated.name %}
  5.         {% set id = product.id %}
  6.         {% set cover = product.cover.media %}
  7.         {% set variation = product.variation %}
  8.         <div class="card product-box box-{{ theme_config('productListingStylesProductBoxVersion') }} box-layout-{{ layout }}">
  9.             {% block component_product_box_content %}
  10.                 <div class="card-body d-flex flex-column justify-content-start">
  11.                     {% block component_product_box_badges %}
  12.                         {% sw_include '@parent/storefront/component/product/card/badges.html.twig' %}
  13.                     {% endblock %}
  14.                     {% block component_product_box_rich_snippets %}
  15.                         {% sw_include '@Storefront/storefront/component/product/card/meta.html.twig' ignore missing %}
  16.                     {% endblock %}
  17.                     {% block component_product_box_image %}
  18.                         <div class="product-image-wrapper flex-grow-0 mb-0">
  19.                             {# fallback if display mode is not set #}
  20.                             {% set displayMode = displayMode ?: 'standard' %}
  21.                             {# set display mode 'cover' for box-image with standard display mode #}
  22.                             {% if layout == 'image' and displayMode == 'standard' %}
  23.                                 {% set displayMode = 'cover' %}
  24.                             {% endif %}
  25.                             <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  26.                                title="{{ name }}"
  27.                                class="product-image-link is-{{ displayMode }}">
  28.                                 {% if cover.url %}
  29.                                     {% set attributes = {
  30.                                         'class': 'lazyload product-image is-'~displayMode,
  31.                                         'data-sizes': "{
  32.                                             'xs': '315px',
  33.                                             'sm': '315px',
  34.                                             'md': '427px',
  35.                                             'lg': '333px',
  36.                                             'xl': '333px'
  37.                                         }",
  38.                                         'alt': (cover.translated.alt ?: name),
  39.                                         'title': (cover.translated.title ?: name)
  40.                                     } %}
  41.                                     {% if displayMode == 'cover' or displayMode == 'contain' %}
  42.                                         {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  43.                                     {% endif %}
  44.                                     {% sw_thumbnails 'product-image-thumbnails' with {
  45.                                         media: cover,
  46.                                         sizes: {
  47.                                             'xs': '315px',
  48.                                             'sm': '315px',
  49.                                             'md': '427px',
  50.                                             'lg': '333px',
  51.                                             'xl': '333px'
  52.                                         },
  53.                                         load: false,
  54.                                         loadOriginalImage: true
  55.                                     } %}
  56.                                 {% else %}
  57.                                     <div class="product-image-placeholder">
  58.                                         {% sw_icon 'placeholder' style {
  59.                                             'size': 'fluid'
  60.                                         } %}
  61.                                     </div>
  62.                                 {% endif %}
  63.                             </a>
  64.                             {% if config('core.cart.wishlistEnabled') %}
  65.                                 {% block component_product_box_wishlist_action %}
  66.                                     {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  67.                                         appearance: 'circle',
  68.                                         productId: id
  69.                                     } %}
  70.                                 {% endblock %}
  71.                             {% endif %}
  72.                             {% block component_product_box_superdeal %}{% endblock %}
  73.                         </div>
  74.                     {% endblock %}
  75.                     {% block component_product_box_info %}
  76.                         <div class="product-info flex-grow-1 d-flex flex-column justify-content-between flex-grow-1">
  77.                             {% block component_product_box_rating %}
  78.                                 {% if theme_config('productListingStylesProductBoxDisplayRating') %}
  79.                                     {% if config('core.listing.showReview') %}
  80.                                         <div class="product-rating">
  81.                                             {% if product.ratingAverage %}
  82.                                                 {% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
  83.                                                     points: product.ratingAverage,
  84.                                                     style: 'text-primary'
  85.                                                 } %}
  86.                                             {% endif %}
  87.                                         </div>
  88.                                     {% endif %}
  89.                                 {% endif %}
  90.                             {% endblock %}
  91.                             {% block component_product_box_manufacturer %}
  92.                                 {% if theme_config('productListingStylesProductBoxDisplayManufacturer') %}
  93.                                     <div class="product-manufacturer">
  94.                                         {{ product.manufacturer.translated.name }}
  95.                                     </div>
  96.                                 {% endif %}
  97.                             {% endblock %}
  98.                             {% block component_product_box_name %}
  99.                                 <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  100.                                    class="product-name {{ theme_config('productListingStylesProductBoxTitleFontFormat') }}"
  101.                                    title="{{ name }}">
  102.                                     {{ name }}
  103.                                 </a>
  104.                             {% endblock %}
  105.                             {% block component_product_box_variant_characteristics %}
  106.                                 {% if theme_config('productListingStylesProductBoxDisplayCharacteristics') and product.variation %}
  107.                                     <div class="product-variant-characteristics">
  108.                                         <div class="product-variant-characteristics-text">
  109.                                             {% for variation in product.variation %}
  110.                                                 {#{{ variation.group }}:#}
  111.                                                 <span class="product-variant-characteristics-option">
  112.                                                     {{ variation.option }}
  113.                                                 </span>
  114.                                                 {% if product.variation|last != variation %}
  115.                                                     {{ " | " }}
  116.                                                 {% endif %}
  117.                                             {% endfor %}
  118.                                         </div>
  119.                                     </div>
  120.                                 {% endif %}
  121.                             {% endblock %}
  122.                             {% block component_product_box_description %}
  123.                                 {% if theme_config('productListingStylesProductBoxDisplayDescription') %}
  124.                                     <div class="product-description">
  125.                                         {{ product.translated.description|striptags|raw }}
  126.                                     </div>
  127.                                 {% endif %}
  128.                             {% endblock %}
  129.                             {% block component_product_box_price_and_action %}
  130.                                 {% if theme_config('productListingStylesCombinePriceAndAction') %}
  131.                                     <div class="flex-grow-1 d-flex flex-nowrap"><div class="product-price-info-wrapper col-auto d-flex mt-auto align-content-end flex-column pr-0 w-75">
  132.                                 {% endif %}
  133.                                 {% block component_product_box_price %}
  134.                                     {% if theme_config('productListingStylesProductBoxDisplayPrices') and layout == 'standard'%}
  135.                                         {% sw_include '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
  136.                                     {% endif %}
  137.                                 {% endblock %}
  138.                                 {% block component_product_box_availabilty %}
  139.                                     {% if theme_config('productListingStylesProductBoxDisplayAvailabilty') %}
  140.                                         {# Preorder #}
  141.                                         {% if product.active and product.releaseDate and product.releaseDate|date('U') > "now"|date('U') %}
  142.                                             {% block box_preorder %}
  143.                                                 <div class="product-availabilty">
  144.                                                     {% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': 'fa-check', 'class': 'far'} %}
  145.                                                     <span>{{ "oo.product.availabilty.inStock"|trans }}</span>
  146.                                                 </div>
  147.                                             {% endblock %}
  148.                                         {# In stock #}
  149.                                         {% elseif product.active and product.availableStock >= product.minPurchase and product.deliveryTime %}
  150.                                             {% block box_in_stock %}
  151.                                                 <div class="product-availabilty">
  152.                                                     {% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': 'fa-check', 'class': 'far'} %}
  153.                                                     <span>{{ "oo.product.availabilty.inStock"|trans }}</span>
  154.                                                 </div>
  155.                                             {% endblock %}
  156.                                         {# Out of stock #}
  157.                                         {% elseif product.isCloseout and product.availableStock < product.minPurchase %}
  158.                                             {% block box_out_of_stock %}
  159.                                                 <div class="product-availabilty out-of-stock">
  160.                                                     {% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': 'fa-truck', 'class': 'fas'} %}
  161.                                                     <span>{{ "oo.product.availability.outOfStock"|trans }}</span>
  162.                                                 </div>
  163.                                             {% endblock %}
  164.                                         {# Restock #}
  165.                                         {% elseif product.availableStock < product.minPurchase and product.deliveryTime and product.restockTime %}
  166.                                             {% block box_restock %}
  167.                                                  <div class="product-availabilty">
  168.                                                     {% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': 'fa-check', 'class': 'far'} %}
  169.                                                     <span>{{ "oo.product.availabilty.inStock"|trans }}</span>
  170.                                                 </div>
  171.                                             {% endblock %}
  172.                                         {# Default (looks like in stock). #}
  173.                                         {% else %}
  174.                                             {% block box_default %}
  175.                                                 <div class="product-availabilty">
  176.                                                     {% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': 'fa-check', 'class': 'far'} %}
  177.                                                     <span>{{ "oo.product.availabilty.inStock"|trans }}</span>
  178.                                                 </div>
  179.                                             {% endblock %}
  180.                                         {% endif %}
  181.                                     {% endif %}
  182.                                 {% endblock %}
  183.                                 {% if theme_config('productListingStylesCombinePriceAndAction') %}
  184.                                     </div><div class="col-auto ml-auto align-self-end pl-0 pr-0">
  185.                                 {% endif %}
  186.                                 {% block component_product_box_action %}
  187.                                     {% if
  188.                                         (theme_config('productListingStylesProductBoxButton') != 'none' and layout != 'image') or
  189.                                         (theme_config('productListingStylesProductBoxImageButton') != 'none' and layout == 'image')
  190.                                     %}
  191.                                             {% sw_include '@Storefront/storefront/component/product/card/action.html.twig' %}
  192.                                     {% endif %}
  193.                                 {% endblock %}
  194.                                 {% if theme_config('productListingStylesCombinePriceAndAction') %}
  195.                                     </div></div>
  196.                                 {% endif %}
  197.                             {% endblock %}
  198.                             {% block component_product_box_siblingslider %}
  199.                                 {% if theme_config('productListingStylesProductBoxDisplaySiblingSlider') and layout == 'standard' %}
  200.                                     <div class="product-sibling-slider">
  201.                                         {% sw_include '@Storefront/storefront/component/product/card/sibling-slider.html.twig' %}
  202.                                     </div>
  203.                                 {% endif %}
  204.                             {% endblock %}
  205.                         </div>
  206.                     {% endblock %}
  207.                 </div>
  208.             {% endblock %}
  209.         </div>
  210.     {% endif %}
  211. {% endblock %}