Hi! Please help me. Customers mostly complain about the preselected variant. Instead of a preselected variant, we want to have the “Select Variant”
{%- liquid
assign picker_type = block.settings.picker_type
assign enable_border_top = block.settings.enable_border_top
assign enable_border_bottom = block.settings.enable_border_bottom
assign color_border = block.settings.color_border
-%}
{%- if variantCount > 0 and product.has_only_default_variant != true -%}
{%- if picker_type == 'button' -%}
{%- assign product_swatch_option = settings.swatch | downcase -%}
{%- for option in product.options_with_values -%}
{%- liquid
assign is_swatch = false
assign option_name = option.name | downcase
if product_swatch_option contains option_name
assign is_swatch = true
endif
assign swatch_type = settings.swatch_type
assign option_index = forloop.index0
assign file_extension = 'png'
-%}
{{ option.name | append: ':' }}
{{ option.selected_value }}
{%- assign values = '' -%}
{%- for variant in product.variants -%}
{%- assign value = variant.options[option_index] -%}
{%- unless values contains value -%}
{%- liquid
assign values = values | join: ';'
assign values = values | append: ';' | append: value
assign values = values | split: ';'
-%}
{%- if is_swatch -%}
{% if swatch_type == 'variant_image' %}
{% endif %}
{%- else -%}
{{ value }}
{%- endif -%}
{%- endunless -%}
{%- endfor -%}
{%- endfor -%}
{%- else -%}
{%- for option in product.options_with_values -%}
{{ option.name | append: ':' }}
{{ option.selected_value }}
{%- for value in option.values -%}
{{ value }}
{%- endfor -%}
{%- endfor -%}
{%- endif -%}
{{ 'products.product.product_variants' | t }}
{%- for variant in product.variants -%}
{{ variant.title }}
{%- if variant.available == false %} - {{ 'products.product.sold_out' | t }}{% endif %}
- {{ variant.price | money | strip_html }}
{%- endfor -%}
{%- endif -%}
@kristinejrb avoid pasting walls of text/code especially unformated, avoid pasting the entirety of file, show only relevant parts.
Others do know what you know about your setup, Always provide specifics:
theme name, and/or provide publicly available urls for contributors to inspect including a storefront password if storefront is password protected
Adding a static option in a selector is generally done in the forloop found in the selector.
I.e.
{%- for value in option.values -%}
Select an option
Plenty of forum discussions on this for various themes, see if there’s on for your.
For vintage themes there is the DIY choose-an-option customization in the docs
To make it work with OS2.0 is an advanced customization requiring knowledge of html, javascript and liquid.
https://help.shopify.com/en/manual/online-store/themes/themes-by-shopify/vintage-themes/customizing-vintage-themes/add-pick-an-option
Though it wouldn’t hurt to contact shopify support and see if this can be done for an OS2.0 theme using a plans free 60 minutes of complementary theme-support .
If you need this customization done for you then contact me directly by mail for services.
Please always provide context , examples: store url, theme name, post url(s) , or any further detail.
Contact Info in signature.