Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix selecting images

Anna Siwik69322d5786d6
diff --git a/templates/dashboard/product/product_variant/_image_select.html b/templates/dashboard/product/product_variant/_image_select.html
index a59cda4ca0..0ca3e5f32a 100644
--- a/templates/dashboard/product/product_variant/_image_select.html
+++ b/templates/dashboard/product/product_variant/_image_select.html
@@ -5,10 +5,10 @@
{% for choice_with_image in choices_with_images %}
{% with choice=choice_with_image.0 image=choice_with_image.1 %}
<div class="image_select-item">
- <input id="{{ choice.id_for_label }}" name="{{ choice.name }}" class="filled-in" type="checkbox" value="{{ choice.choice_value }}" {% if choice.choice_value in choice.value %} checked="checked" {% endif %}>
+ <input id="{{ choice.id_for_label }}" name="{{ choice.data.name }}" class="filled-in" type="checkbox" value="{{ choice.data.value }}" {% if choice.data.selected %}checked{% endif %}>
<label for="{{ choice.id_for_label }}"></label>
<img id="{{ choice.id_for_label }}" class="responsive-img" src="{{ image.image.crop.200x200 }}" srcset="{{ image.image.crop.200x200 }} 1x" alt="">
- <div id="{{ choice.id_for_label }}" class="image_select-item-overlay {% if choice.choice_value in choice.value %}checked{% endif %}"></div>
+ <div id="{{ choice.id_for_label }}" class="image_select-item-overlay{% if choice.data.selected %} checked{% endif %}"></div>
</div>
{% endwith %}
{% endfor %}