Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add img-wrapper in product item view to make all product images have same size

jxltom9aff316aa7f2
diff --git a/templates/product/_items.html b/templates/product/_items.html
index c63b7c0e10..79a5959995 100644
--- a/templates/product/_items.html
+++ b/templates/product/_items.html
@@ -9,11 +9,13 @@
<a href="{{ product.get_absolute_url }}" class="link--clean">
<div class="text-center">
<div>
- <img class="img-responsive lazyload lazypreload"
- data-src="{% get_thumbnail product.get_first_image method="thumbnail" size=255 %}"
- data-srcset="{% get_thumbnail product.get_first_image method="thumbnail" size=255 %} 1x, {% get_thumbnail product.get_first_image method="thumbnail" size=510 %} 2x"
- alt=""
- src="{% placeholder size=255 %}">
+ <div class="img-wrapper" style="height: 255px;">
+ <img class="img-responsive lazyload lazypreload"
+ data-src="{% get_thumbnail product.get_first_image method="thumbnail" size=255 %}"
+ data-srcset="{% get_thumbnail product.get_first_image method="thumbnail" size=255 %} 1x, {% get_thumbnail product.get_first_image method="thumbnail" size=510 %} 2x"
+ alt=""
+ src="{% placeholder size=255 %}">
+ </div>
<span class="product-list-item-name" title="{{ product.translated }}">{{ product.translated }}</span>
</div>
<div class="panel-footer">