{% doc %} Renders a featured product card for the homepage hero. @param {product} product - Product to show in the card @example {% render 'hero-product', product: block.settings.product %} {% enddoc %} {% liquid assign variant = product.selected_or_first_available_variant assign card_image = product.featured_image assign hover_image = blank assign image_alt = card_image.alt | default: product.title for image in product.images offset: 1 limit: 1 assign hover_image = image endfor %}
{% if card_image %} {{ card_image | image_url: width: 200 | image_tag: alt: image_alt, widths: '100, 140, 200', sizes: '(max-width: 1023px) 70px, 100px', class: 'hero__card-image', loading: 'eager' }} {% if hover_image != blank %} {{ hover_image | image_url: width: 200 | image_tag: alt: '', widths: '100, 140, 200', sizes: '(max-width: 1023px) 70px, 100px', class: 'hero__card-image hero__card-image--hover', loading: 'lazy' }} {% endif %} {% endif %}
{{ product.title | escape }}

{{ variant.price | money_without_trailing_zeros }}

{% form 'product', product, class: 'hero__form' %} {% endform %}