Skip to content

Commit

Permalink
Use picsum.photos only when product has no image
Browse files Browse the repository at this point in the history
  • Loading branch information
notFloran committed Apr 18, 2024
1 parent bc0ae8c commit 1ba7228
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 1ba7228

Please sign in to comment.