diff --git a/assets/global.js b/assets/global.js index d513cc6..113369b 100644 --- a/assets/global.js +++ b/assets/global.js @@ -1090,6 +1090,10 @@ class VariantSelects extends HTMLElement { } ); + document.querySelectorAll('shx-drehteller').forEach((drehteller) => { + drehteller.reloadCurrentVariant(this.currentVariant.featured_image.alt); + }); + } else { // show all thumbnails document.querySelectorAll('[thumbnail-alt]').forEach((thumbnail) => { diff --git a/snippets/shx-product-desc.liquid b/snippets/shx-product-desc.liquid index 2a4704b..b00d711 100644 --- a/snippets/shx-product-desc.liquid +++ b/snippets/shx-product-desc.liquid @@ -9,12 +9,24 @@ constructor() { super(); // element functionality written in here + this.currentVariant = null; } connectedCallback() { this.attachShadow({ mode: 'open' }); // Attach a shadow root to the element. this.shadowRoot.innerHTML = `