templates/product/product_teaser.html.twig line 1

Open in your IDE?
  1. {% set detailLink = app_product_detaillink(product) %}
  2. <a href="{{ detailLink }}" class="relative flex flex-col overflow-hidden bg-gray-100 hover:shadow-xl-center rounded-lg transition ease duration-300">
  3.     <div class="w-full overflow-hidden lg:h-50 px-3 pt-3">
  4.         {{ (product.mainImage is not empty ? product.mainImage.thumbnail('productThumbnail').html : pimcore_asset_by_path('/System/missing.png').thumbnail('productThumbnail').html ) | raw }} {# class="w-full h-full object-center object-cover sm:w-full sm:h-full" #}
  5.     </div>
  6.     {% if product.discontinued %}
  7.     <span class="absolute top-2 right-2 bg-brand-600 text-center text-white text-xs rounded-full px-2 py-1">Auslaufartikel</span>
  8.     {% endif %}
  9.     {% if product.productGroup %}
  10.         <div class="flex" style="max-width: 9rem">
  11.             <span class="text-white text-sm rounded-r-full pl-4 pr-8 py-1 w-fit mt-4" style="background-color: {{ product.productGroup.color | slice(0,7) }};">{{ product.productGroup.name }}</span>
  12.         </div>
  13.     {% endif %}
  14.     <div class="p-4 flex flex-1 flex-col space-y-2">
  15.         <h3 class="text-md text-gray-900 leading-tight">
  16.             {{ product.name }}
  17.         </h3>
  18.         <div class="flex flex-1 flex-col justify-end">
  19.             <p class="text-sm text-gray-500">{{ product.code }}</p>
  20.         </div>
  21.     </div>
  22. </a>