Sometimes you might want to use Option Price Calculator with Shopify built in product options. This allows you to manage some aspects on the product instead of the app which may make management easier in some cases.
Option Price Calculator can handle this scenario just fine but new variants will be added to you to the back end and will intern showup in side these option on the product page.
You will want to hide these.
Below is some code you can use on a product page to hide the variants created by the app.
{% comment %}
This for loop will determine the number of option variants not related to Option Price Calculator. All products have at least 1 option. Option Price Calculator options will be filtered out resulting an a variant count that not include OPC variants.
"opc-" assumes option set New Variant SKU is configured to use "Created by app (random)" This will always start with "opc-". You can change this value to something else if you have custom skus. SKUS must have an identifier to know it is from Option Price Calculator or this will not work.
{% endcomment %}
{%- assign opc_variant_count = 0 -%}
{%- for value in option.values -%}
{% unless value contains "opc-" %}
{% assign opc_variant_count = variant_count | plus: 1 %}
{% endunless %}
{%- endfor -%}
{% comment %}
This if condition should wrap your variant selector code. It will hide the variant selector if there is only a Default variant or only Default and Option Price Calculator variants.
{% endcomment %}
{% if opc_variant_count > 1 %}
{%- for value in option.values -%}
{% comment %}
Variants not containing "opc-" will be added to the variant selector.
Option Price calculator variants will not be added.
{% endcomment %}
{% unless value contains "opc-" %}
{% endunless %}
{%- endfor -%}
{%- endif -%}