templates/Shop/product_teaser.html.twig line 1

Open in your IDE?
  1. {% set productImg = product.getFirstImageAsset %}
  2. {% if not editmode %}
  3.     {% set linkDetail = app_product_generate_link(product, { 'document' : document, 'prefix': prefix } , {}) %}
  4. {% endif %}
  5. {% set defaultPrice = app_product_default_price(product) %}
  6. {# Determine if product is a kit (align with productDetail controller using getKitProducts) #}
  7. {% set kit = product.getKitProducts() %}
  8. {% set hasVariantKits = product.hasVariantKits() %}
  9. {% set isPartOfKit = product.isPartOfKit() %}
  10. {#{% set defaultPriceWithDiscount = app_product_default_price_with_discount(product,userIdSage) %}#}
  11. <style>
  12.     .card-img-top {
  13.         position: absolute;
  14.         top: -50px;
  15.         left: 50%;
  16.         margin-left: -50px;
  17.         width: 100px !important;
  18.         height: 100px;
  19.         transition: transform 0.3s ease;
  20.     }
  21.     .card:hover .card-img-top {
  22.         transform: scale(1.2);
  23.     }
  24.     .card {
  25.         font-family: "Roboto";
  26.         text-transform: lowercase;
  27.         margin-top: 30px;
  28.         padding-top: 30px;
  29.         box-shadow: 0 0 10px rgba(0, 0, 0, 0.07);
  30.         height: 170px;
  31.         position: relative;
  32.     }
  33.     .card a {
  34.         color: inherit;
  35.     }
  36.     .card-title {
  37.         display: block;
  38.         font-weight: 600;
  39.     }
  40.     .card-title:first-letter {
  41.         text-transform: uppercase;
  42.     }
  43.     .card:hover .card-title {
  44.         color: #106eea;
  45.     }
  46.     @media (max-width: 991px) {
  47.         .col-md-3,
  48.         .col-6 {
  49.             flex: 0 0 50%;
  50.             max-width: 50%;
  51.         }
  52.         .card {
  53.             height: 250px;
  54.             padding-top: 10px;
  55.         }
  56.     }
  57.     @media (min-width: 768px) and (max-width: 991px) {
  58.         .col-md-3,
  59.         .col-6 {
  60.             width: 100%;
  61.             flex: 0 0 50%;
  62.             max-width: 50%;
  63.         }
  64.         .card {
  65.             height: 250px;
  66.             width: 200px;
  67.             padding-top: 10px;
  68.             margin: 10px 100px 10px 90px;
  69.         }
  70.     }
  71.     @media (min-width: 991px) {
  72.         .card {
  73.             height: 250px;
  74.         }
  75.     }
  76. </style>
  77. {% if not isPartOfKit %}
  78. <div class="col-6 col-sm-6 col-md-3 mt-5">
  79.     <div class="card">
  80.     {% if kit or hasVariantKits %}
  81.         <div class="teaser-kit-icon">
  82.             <img aria-hidden="true" src="{{ asset(pimcore_asset_by_path('/iconos/kit-icon.png').thumbnail('DefaultThumbnail')) }}">
  83.         </div>
  84.     {% endif %}
  85.         <a href="{{ editmode ? '#':linkDetail }}" class="px-3">
  86.             <img class="card-img-top" src="{{ (productImg) ? productImg.thumbnail('ProductImages') : '' }}" alt="Card image cap">
  87.             <div class="card-block text-center mt-5">
  88.                 <span class="card-title fs-6">{{ product.getName() }}</span>
  89.                 {# if product have propspeed brand hide price #}
  90. {#                {% if is_authenticated or product.marca != 15663 %}#}
  91. {#                    <p class="card-position card-price fs-6">{{ app_helper_price_format_spain(defaultPrice) }}€</p>#}
  92. {#                {% endif %}#}
  93.             </div>
  94.         </a>
  95.     </div>
  96. </div>
  97. {% endif %}