Sometimes you want to offer only a variant of your products to customers, however, due to Shopify's structure, this will not be displayed by default without some custom coding. Luckily we have a quick solution to even further customize your offers!
First, you will need to ensure only the offered variant is checked in the Products to offer section:
Then in the Look and Feel section, place the following code below your Offer Text:
<script>$(".nudge-offer .variants-wrapper select option").first().attr("selected","selected"); $(".nudge-offer .variants-wrapper select").trigger("change");</script> OR<script> document.querySelector(".nudge-offer .variants-wrapper select option:first-child").setAttribute("selected","selected"); document.querySelector(".nudge-offer .variants-wrapper select").dispatchEvent(new Event('change')) </script>
Save and you're all done! The selected variant's image will always be the default for that offer. If you're having any questions or concerns then we're always ready to help!