Skip to content

Commit

Permalink
refactor: improve LCP on product miniature
Browse files Browse the repository at this point in the history
  • Loading branch information
buggyzap authored Jan 29, 2024
1 parent 51ece31 commit 4f17cd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/catalog/_partials/miniatures/product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<img
src="{$product.cover.bySize.home_default.url}"
alt="{if !empty($product.cover.legend)}{$product.cover.legend}{else}{$product.name|truncate:30:'...'}{/if}"
loading="lazy"
{if isset($position) && $position < 4}fetchpriority="high"{else}loading="lazy"{/if}
data-full-size-image-url="{$product.cover.large.url}"
width="{$product.cover.bySize.home_default.width}"
height="{$product.cover.bySize.home_default.height}"
Expand All @@ -50,7 +50,7 @@
{if !empty($urls.no_picture_image.bySize.home_default.sources.webp)}<source srcset="{$urls.no_picture_image.bySize.home_default.sources.webp}" type="image/webp">{/if}
<img
src="{$urls.no_picture_image.bySize.home_default.url}"
loading="lazy"
{if isset($position) && $position < 4}fetchpriority="high"{else}loading="lazy"{/if}
width="{$urls.no_picture_image.bySize.home_default.width}"
height="{$urls.no_picture_image.bySize.home_default.height}"
/>
Expand Down

0 comments on commit 4f17cd1

Please sign in to comment.