Change Offer Image to Variant Image

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>


document.querySelector(".nudge-offer .variants-wrapper select option:first-child").setAttribute("selected","selected");  
document.querySelector(".nudge-offer .variants-wrapper select").dispatchEvent(new Event('change'))
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!
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us