I need to hide Material option from product page because I only needed it in product grids of collection pages. I tried different css tweaks mentioned on previous posts but to no avail. Below are Product form and variant button code files. Kindly suggest changes to remove only the Material option from product page
product-form.liquid
{% capture form_id %}AddToCartForm-{{ section_id }}{% endcapture %}
{% form ‘product’, product, id: form_id, class: ‘product-single__form’ %}
{% unless product.has_only_default_variant %}
{% for option in product.options_with_values %}
{%- if option_name contains ‘material’ or option_name contains ‘Material’ -%}
{% style %}
.variant__button-label{
display: none;
}
{% endstyle %}
{%- endif -%}
{% if settings.variant_type == ‘button’ %}
{% include ‘variant-button’, section_id: section_id, option_drop: option %}
{% else %}
{% include ‘variant-dropdown’, section_id: section_id %}
{% endif %}
{% endfor %}
{% endunless %}
{% if settings.quantity_enable %}
{%- assign inventory_visible = false -%}
{%- if settings.inventory_enable and current_variant.inventory_management == ‘shopify’ -%}
{%- if current_variant.inventory_quantity <= settings.inventory_threshold and current_variant.inventory_quantity >= 0 -%}
{%- assign inventory_visible = true -%}
{%- endif -%}
{%- endif -%}
{%- if current_variant.inventory_quantity == 0 -%}
{%- assign inventory_visible = false -%}
{%- endif -%}
{%- if settings.inventory_transfers_enable -%}
{%- assign enable_dynamic_buttons = false -%}
{% if settings.enable_payment_button and template != ‘product.preorder’ %}
{%- assign enable_dynamic_buttons = true -%}
{% endif %}
{% if enable_dynamic_buttons %}
<button
{% if product.empty? %}type=“button”{% else %}type=“submit”{% endif %}
name=“add”
id=“AddToCart-{{ section_id }}”
class=“btn btn–full add-to-cart{% if enable_dynamic_buttons %} btn–secondary{% endif %}”
{% unless current_variant.available %} disabled=“disabled”{% endunless %}>
{% if current_variant.available %}
{% if template == ‘product.preorder’ %}
{{ ‘products.product.preorder’ | t }}
{% else %}
{{ ‘products.product.add_to_cart’ | t }}
{% endif %}
{% else %}
{{ ‘products.product.sold_out’ | t }}
{% endif %}
{% if enable_dynamic_buttons %}
{{ form | payment_button }}
{% endif %}
{% if enable_dynamic_buttons %}
variant-button.liquid
{%- assign swatch_file_extension = ‘png’ -%}
{%- assign is_color = false -%}
{%- assign color_swatch_drop = option_drop -%}
{%- assign color_option_index = 0 -%}
{%- if settings.product_color_swatches -%}
{%- for option in product.options_with_values -%}
{%- if option == color_swatch_drop -%}
{%- assign color_option_index = forloop.index0 -%}
{%- assign downcased_option = color_swatch_drop.name | downcase -%}
{%- if downcased_option contains ‘color’ or downcased_option contains ‘colour’ -%}
{%- assign is_color = true -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- for value in option.values -%}
{%- assign product_available = true -%}
{%- if product.options.size == 1 -%}
{%- assign product_available = product.variants[forloop.index0].available -%}
{%- endif -%}
{%- if is_color -%}
{%- assign color_image = value | handle | append: ‘.’ | append: swatch_file_extension | asset_img_url: ‘50x’ | prepend: ‘https:’ -%}
{%- assign color_swatch_fallback = value | split: ’ ’ | last | handle -%}
<label
for=“ProductSelect-{{ section_id }}-option-{{ option.name | handleize }}-{{ value | url_encode }}”
class=“variant__button-label color-swatch color-swatch–{{ value | handle }}{% unless product_available %} disabled{% endunless %}”
style=“background-image: url({{ color_image }}); background-color: {{ color_swatch_fallback }};”
{{ value | escape }}
{%- else -%}
{{ value | escape }}
{%- endif -%}
{%- endfor -%}