How to hide variants created by Option Price Calculator.

Option Price Calculator will create variants when products are added to cart. This is a Shopify requirement.

If you do not want these new variants to appear in your Shopify default options, you can do the following:

Open your main-product.liquid or other product liquid page that renders your product variants or variants picker and look for code or similar code:

<variant-radios class="no-js-hidden" data-section="{{ section.id }}" data-url="{{ product.url }}" {{ block.shopify_attributes }}>
              {%- for option in product.options_with_values -%}
                  <fieldset class="js product-form__input">
                    <legend class="form__label">{{ option.name }}</legend>
                    {%- for value in option.values -%}
                      <input type="radio" id="{{ section.id }}-{{ option.position }}-{{ forloop.index0 }}"
                            name="{{ option.name }}"
                            value="{{ value | escape }}"
                            form="{{ product_form_id }}"
                            {% if option.selected_value == value %}checked{% endif %}
                      >
                      <label for="{{ section.id }}-{{ option.position }}-{{ forloop.index0 }}">
                        {{ value }}
                      </label>
                    {%- endfor -%}
                  </fieldset>
              {%- endfor -%}
              <script type="application/json">
                {{ product.variants | json }}
              </script>
            </variant-radios>

You will want to add the following to the code above:

{%- unless value contains “opc-” -%}
{%- endunless -%}

The new block would look like the following:

  <variant-radios class="no-js-hidden" data-section="{{ section.id }}" data-url="{{ product.url }}" {{ block.shopify_attributes }}>
                  {%- for option in product.options_with_values -%}
                      <fieldset class="js product-form__input">
                        <legend class="form__label">{{ option.name }}</legend>
                        {%- for value in option.values -%}
                          {%- unless value contains "opc-" -%}

                          <input type="radio" id="{{ section.id }}-{{ option.position }}-{{ forloop.index0 }}"
                                name="{{ option.name }}"
                                value="{{ value | escape }}"
                                form="{{ product_form_id }}"
                                {% if option.selected_value == value %}checked{% endif %}
                          >
                          <label for="{{ section.id }}-{{ option.position }}-{{ forloop.index0 }}">
                            {{ value }}
                          </label>

                          {%- endunless -%}
                        {%- endfor -%}
                      </fieldset>
                  {%- endfor -%}
                  <script type="application/json">
                    {{ product.variants | json }}
                  </script>
                </variant-radios>