Skip to content

Commit

Permalink
Merge pull request #124 from Akollade/fix-product-main-image
Browse files Browse the repository at this point in the history
Use picsum.photos only when product has no image
  • Loading branch information
oallain committed Apr 18, 2024
2 parents bc0ae8c + 1ba7228 commit 1a86e15
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
{% elseif product.images.first %}
{% set path = product.images.first.path|imagine_filter(filter|default('sylius_shop_product_thumbnail')) %}
{% else %}
{% endif %}
{% set size = random(5) * 200 %}
{% set path = "https://picsum.photos/#{ size }/#{ size }.jpg" %}
{% endif %}

<div class="ratio ratio-1x1">
<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') }} />
Expand Down

0 comments on commit 1a86e15

Please sign in to comment.