Add a product to the variants section of another product

How do I make products appear in the variant section on another product page?

For example: I have a headphones shop with several models in different colours. I wanted to put the other remaining models (but with different colours, prices and names) on each headphone’s page in the variant section.

If anyone can help me, I’d really appreciate it.

Hello @goncalo22 ,

We can’t use other products as variants but we can display them as a variant.

Metafields is the solution for it.

  1. You need to create metafield for product with field type product ( list product )

Once this option is enabled in the products you are ready to select the different products for a specific product.

  1. In this step you need to edit the code or with a custom liquid block add the logic to display the metafield as a variant and on change of the value redirect to the target product.
    I suggest creating a snippet and calling it in the custom liquid block.

Hope this will give you an idea how it will work.

Thanks

could you please help me then?

Yes, you can drop an email to discuss further.

sure