Skip to content

Commit 1a86e15

Browse files
authored
Merge pull request #124 from Akollade/fix-product-main-image
Use picsum.photos only when product has no image
2 parents bc0ae8c + 1ba7228 commit 1a86e15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/bundles/SyliusShopBundle/Product/_mainImage.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
{% elseif product.images.first %}
44
{% set path = product.images.first.path|imagine_filter(filter|default('sylius_shop_product_thumbnail')) %}
55
{% else %}
6-
{% endif %}
76
{% set size = random(5) * 200 %}
87
{% set path = "https://picsum.photos/#{ size }/#{ size }.jpg" %}
8+
{% endif %}
99

1010
<div class="ratio ratio-1x1">
1111
<img src="{{ path }}" alt="{{ product.name }}" class="{{ class|default('') }} object-fit-cover rounded-3 border border-light bg-light" {{ sylius_test_html_attribute('main-image') }} />

0 commit comments

Comments
 (0)