Change Featured Image based on Radio selection - not variant selection

Solved
Tourist
4 1 0

Working with the Supply theme, I've added Radio buttons for custom engraving and product layout.  I'm not using variants on the product, but want the image to change depending on which radio button is selected.  Everything I've tried breaks the click/change of the image and still doesn't produce a different image with the click of the radio button.

 

I have this on for the radio buttons:

 

<p class="line-item-property__field">
<label for="engraved-name">Name to be Engraved - limit 15 characters</label>
<input required class="required" id="engraved-name" type="text" name="properties[Engraved Name]" maxlength="15">
</p>

<p class="line-item-property__field" id="alignment">
<label>Select Layout</label>
<input required class="required" type="radio" name="properties[_Select Layout]" value="left" id="radio_left" checked="checked"> <span>Connector hole LEFT</span><br>
<input required class="required" type="radio" name="properties[_Select Layout]" value="right" id="radio_right"> <span>Connector hole RIGHT</span><br>
</p>

 

I had this for the jquery:

 

    $(document).ready(function(){

        $("input:radio[properties[_Select Layout]]").click(function() {

            var value = $(this).val();

            var image_name;

            if(value == ‘left’){

                image_name = "product.image.last";

            }else{

                if(value == ‘right’){

                    image_name = "product.featured_image";

                }else{

                    image_name = "product.featured_image";

                }

            }

          

              {% assign featured_image = image_name %}

        });

    });

 

Nothing.  Any ideas?

0 Likes
Shopify Partner
1129 90 138

Hi @Todd_Hewitt1,

 

Could you please provide website URL?

Thanks & Regards
Perennial Solution

Problem Solved?✔️Like and Accept the solution that can help others.
Need any help with theme customization or design? Hire us
Email: infoperennialsolution@gmail.com
Skype: infoperennialsolution
0 Likes
Shopify Partner
1129 90 138

Thanks for providing website URL. 

I would like to know if you want to add swatches for these options or you would like to edit it on code-level. 

Looking forward to your response.

Thanks & Regards
Perennial Solution

Problem Solved?✔️Like and Accept the solution that can help others.
Need any help with theme customization or design? Hire us
Email: infoperennialsolution@gmail.com
Skype: infoperennialsolution
0 Likes
Tourist
4 1 0

I would like the option selected to change the image shown.

0 Likes

Success.

Tourist
4 1 0

Thanks anyway.  I worked through my own solution. 😊

0 Likes