@zomex Hey there Is a need to change 3 files and maybe add some CSS so your images will show right, I will copy and paste the codes of files just to let you know most of the time we create separate files so we don’t mess with Dawn default code for featured upgrades so you maybe need to change section names accordingly + in code where you see section name so
First file you need to change is pc-product-variant-picker.liquid we use prefix pc- so the original is product-variant-picker.liquid
{% comment %}
Renders product variant-picker
Accepts:
- product: {Object} product object.
- block: {Object} passing the block information.
- product_form_id: {String} Id of the product form to which the variant picker is associated.
- update_url: {Boolean} whether or not to update url when changing variants. If false, the url isn't updated. Default: true (optional).
Usage:
{% render 'product-variant-picker', product: product, block: block, product_form_id: product_form_id %}
{% endcomment %}
{%- unless product.has_only_default_variant -%}
{%- endunless -%}
The second file is pc-product-variant-options.liquid so original was product-variant-options.liquid
{% comment %}
Renders product variant options
Accepts:
- product: {Object} product object.
- option: {Object} current product_option object.
- block: {Object} block object.
- picker_type: {String} type of picker to dispay
Usage:
{% render 'product-variant-options',
product: product,
option: option,
block: block
picker_type: picker_type
%}
{% endcomment %}
{%- liquid
assign variants_available_arr = product.variants | map: 'available'
assign variants_option1_arr = product.variants | map: 'option1'
assign variants_option2_arr = product.variants | map: 'option2'
assign variants_option3_arr = product.variants | map: 'option3'
assign product_form_id = 'product-form-' | append: section.id
-%}
{%- for value in option.values -%}
{%- liquid
assign option_disabled = true
for option1_name in variants_option1_arr
case option.position
when 1
if variants_option1_arr[forloop.index0] == value and variants_available_arr[forloop.index0]
assign option_disabled = false
endif
when 2
if option1_name == product.selected_or_first_available_variant.option1 and variants_option2_arr[forloop.index0] == value and variants_available_arr[forloop.index0]
assign option_disabled = false
endif
when 3
if option1_name == product.selected_or_first_available_variant.option1 and variants_option2_arr[forloop.index0] == product.selected_or_first_available_variant.option2 and variants_option3_arr[forloop.index0] == value and variants_available_arr[forloop.index0]
assign option_disabled = false
endif
endcase
endfor
if value.swatch.image
assign image_url = value.swatch.image | image_url: width: 50
assign swatch_value = 'url(' | append: image_url | append: ')'
elsif value.swatch.color
assign swatch_value = 'rgb(' | append: value.swatch.color.rgb | append: ')'
else
assign swatch_value = nil
endif
-%}
{%- capture input_id -%}
{{ section.id }}-{{ option.position }}-{{ forloop.index0 -}}
{%- endcapture -%}
{%- capture label_unavailable %}
{{- 'products.product.variant_sold_out_or_unavailable' | t -}}
{%- endcapture %}
{%- if picker_type == 'swatch' -%}
{% assign checked = false %}
{% if option.selected_value == value %}
{% assign checked = true %}
{% endif %}
{%
render 'pc-swatch-input',
id: input_id,
name: option.name,
value: value | escape,
product_form_id: product_form_id,
checked: checked,
disabled: option_disabled,
shape: block.settings.swatch_shape,
help_text: label_unavailable
%}
{%- elsif picker_type == 'button' -%}
{% assign image_exist = '' %}
{% for variant in product.variants %}
{% if variant.title == value %}
{% assign image_exist = variant.image %}
{% break %}
{% endif %}
{% endfor %}
{%- elsif picker_type == 'dropdown' or picker_type == 'swatch_dropdown' -%}
{%- endif -%}
{%- endfor -%}
The final third file will be pc-swatch-input.liquid so original swatch-input.liquid
{% comment %}
Renders a swatch input component.
Accepts:
- id: {String} unique input id
- name: {String} input name,
- value: {ProductOptionValueDrop} input value,
- product_form_id: {String} id of the form associted with the input
- checked: {Boolean} default checked status
- disabled: {Boolean} default disabled status
- shape: {String} swatch shape. Accepts 'square', defaults to circle.
- help_text: {String} additional content to render inside the label
Usage:
{% render 'swatch-input',
id: input_id,
name: input_name,
value: input_value,
product_form_id: product_form_id,
checked: checked,
disabled: disabled,
shape: 'square'
help_text: 'help text'
%}
{% endcomment %}
And here is some CSS that you can add to some files for styles like base.css
.pc-product fieldset.js.product-form__input.product-form__input--pill {
display: flex;
gap: 12px;
flex-wrap: wrap;
}
.pc-product fieldset.js.product-form__input.product-form__input--pill .photo-variant {
text-align: center;
}
.pc-product fieldset.js.product-form__input.product-form__input--pill .photo-variant label {
text-align: center;
font-size: 12px;
font-style: normal;
line-height: normal;
border: 0;
padding: 0;
margin: 0;
background: none;
}
.pc-product fieldset.js.product-form__input.product-form__input--pill label{
cursor:pointer;
}
.pc-product fieldset.js.product-form__input.product-form__input--pill .photo-variant .var-image {
display: flex;
margin-bottom: 10px;
}
.pc-product fieldset.js.product-form__input.product-form__input--pill .photo-variant span.varient-text {
color: #101010;
text-align: center;
font-size: 12px;
line-height: normal;
}
.pc-product fieldset.js.product-form__input.product-form__input--pill .photo-variant input:checked + label img {
border: 1px solid #101010;
}
.pc-product .var-outer input:checked + label span.varient-text {
color: #fff !important;
}
.pc-product .photo-variant input:checked + label span.varient-text {
color: #101010 !important;
}
I hope this helps If you have any questions or concerns feel free to reach out! 