summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Rehnelt <noreply@maennchen1.de>2026-10-03 15:08:42 +0200
committerRoger Rehnelt <noreply@maennchen1.de>2026-10-03 15:08:42 +0200
commit1c4c1bdde07f9259a3e2301729a4a09155a2f517 (patch)
tree463018e9800415b6effa7157234125f62e43b61e
parent3e4d53c83300ab377e22faf51a1841ca94743052 (diff)
Produktseite: Bilder schneller im Modus „neu“
Das sichtbare Produktbild lädt sofort und zuerst, verborgene Galeriebilder erst beim Zeigen, Vorschaubilder in passender Größe. Der QR-Code im GARAN-Label hat feste Maße. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
-rw-r--r--views/produktseite/produkt.phtml5
1 files changed, 3 insertions, 2 deletions
diff --git a/views/produktseite/produkt.phtml b/views/produktseite/produkt.phtml
index 0703462..313bac7 100644
--- a/views/produktseite/produkt.phtml
+++ b/views/produktseite/produkt.phtml
@@ -77,7 +77,8 @@
<meta itemprop="image" content="<?php echo esc_url((string)($att[0]??'')); ?>" />
<a class="wpsg-product__image" <?php if ($attachment_id != $arAttachmentID) echo 'style="display:none;"'; ?> rel="gallery-wpsg-<?php echo $this->getTemplateIndex(); ?>" title="<?php echo esc_attr($oProduct->getProductName()); ?>" href="<?php echo esc_url((string)($att[0]??'')); ?>" data-fslightbox="<?php echo $this->getTemplateIndex(); ?>" data-wpsg-image="<?php echo intval($i); ?>">
- <?php echo wp_get_attachment_image($attachment_id, 'large', false, ['sizes' => '(min-width: 800px) 50vw, 100vw']); ?>
+ <?php /* Sichtbares Bild des Hauptprodukts sofort und zuerst laden, verborgene erst beim Zeigen (W6) */ $bShown = ($attachment_id == $arAttachmentID); ?>
+ <?php echo wp_get_attachment_image($attachment_id, 'large', false, ['sizes' => '(min-width: 800px) 50vw, 100vw', 'loading' => (($bShown && $bMainProduct)?false:'lazy'), 'fetchpriority' => (($bShown && $bMainProduct)?'high':'auto')]); ?>
</a>
<?php } ?>
@@ -87,7 +88,7 @@
<?php if ($nImages > 1) { ?>
<ul class="wpsg-product__thumbs">
<?php foreach ($arAttachmentIDsAll as $i => $attachment_id) { ?>
- <li><button type="button" class="wpsg-product__thumb" data-wpsg-image="<?php echo intval($i); ?>" aria-pressed="<?php echo (($attachment_id == $arAttachmentID)?'true':'false'); ?>" aria-label="<?php /* translators: 1: Nummer des Bildes, 2: Anzahl */ echo esc_attr(sprintf(__('Bild %1$d von %2$d anzeigen', 'wpsg'), $i + 1, $nImages)); ?>"><?php echo wp_get_attachment_image($attachment_id, 'thumbnail', false, ['alt' => '']); ?></button></li>
+ <li><button type="button" class="wpsg-product__thumb" data-wpsg-image="<?php echo intval($i); ?>" aria-pressed="<?php echo (($attachment_id == $arAttachmentID)?'true':'false'); ?>" aria-label="<?php /* translators: 1: Nummer des Bildes, 2: Anzahl */ echo esc_attr(sprintf(__('Bild %1$d von %2$d anzeigen', 'wpsg'), $i + 1, $nImages)); ?>"><?php echo wp_get_attachment_image($attachment_id, 'medium', false, ['alt' => '', 'sizes' => '(min-width: 800px) 8rem, 25vw', 'loading' => false]); ?></button></li>
<?php } ?>
</ul>
<?php } ?>