Dissable the cart for a Value withing a Product

Topic summary

A user is seeking help to conditionally disable the cart functionality for specific product variants in their e-commerce store.

Product Structure:

  • Products have multiple size variants
  • Each size has both a full product version (e.g., 150×4/15×1900 at €70/sqm) and a SAMPLE version (e.g., SAMPLE 150×4/15×1900 at €5)

Desired Behavior:

  • Variants containing “SAMPLE” in the name: Show normal cart/purchase functionality
  • Variants WITHOUT “SAMPLE”: Hide the cart button, display price, and show a “Contact us to order” button linking to the contact page

Technical Context:

  • Tagged with HTML, JavaScript, and Liquid (suggesting a Shopify store)
  • Looking for code modifications to implement conditional logic based on variant names

Status: The question remains unanswered with no solutions or suggestions provided yet.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

Hi, I would really appreciate some help in achieving the following, if someone sees how :slightly_smiling_face:

I have a product which is for example: (All the products will be like this)

Engineered Oak - Classic Grade - UNFINISHED - 4mm Top Layer
within this product I have created the variant > SIZE
Inside Variant SIZE I have various sizes.
For each size there is a SAMPLE version of it.
For example
1504/151900 price 70 Euros sqm
and
SAMPLE 1504/151900 Price 5 euros

What I would like to achieve is that the cart disappears when 1504/151900 is selected but the price for that option is still visible (70 euros), and a button appears when selecting 1504/151900 that says ‘Contact us to order’ (directing to Contact Us Page).
In other words I only want to sale online the SAMPLE variant values = SAMPLE 1504/151900

Is it possible to modify the coding in order that only products with the word SAMPLE on them are purchasable?
All the other (meaning all products that dont have the word ‘SAMPLE’ on them) will just show a button ‘Contact Us to Order’ that will refer them to our Contact Us page.

Thank you very much in advance for any ideas and help!
Very much appreciated