hiding variants from product page

I want to make variants for my products so i can use them for filters in the shop page.

But in the product page i want to have only the weight variant. Is there a way to modify this with code so i can hide the other 2? (remove flavor and type)

Hello @3pppz .
Our team is ready to help you.
Please share your website address and access password (if necessary) so that we can check and assist you.

Hello @3pppz
would you like to share your store URL and password if any please.
so i can check and provide you possible solution for your question.

https://philsgranola.myshopify.com/

pass : phils

https://philsgranola.myshopify.com/

pass: phils

  • Here is the solution for you @3pppz
  • Please follow these steps:

  • Then find the base.css or theme.css file.
  • Then add the following code at the end of the file and press ‘Save’ to save it.
.product-form__input:not(:first-child) {
 display: none !important;
}
  • Here is the result you will achieve:

  • Please press ‘Like’ and mark it as ‘Solution’ if you find it helpful. Thank you.

You can add code by following these steps

  1. Go to Online Store → Theme → Edit code.

  2. Open your theme.liquid file

  3. Paste the below code before on theme.liquid

.product .product-form__input.product-form__input--pill:nth-child(2), .product-form__input.product-form__input--pill:nth-child(3) { display: none !important; }

Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.

Hello, this code does not work on a listing that has a drop down for variants, such as at the link below. Any solutions here? Thanks so much!

https://greenplanetprint.com/collections/ready-to-ship-cotton-fabric/products/hummingbirds-lemons-fabric-h