Is there a way to add a required text input on checkout to only a specific product, I have seen ways to plug it in the main-product-liquid but I just want it to show for specific product not all products.
Well you could use a metafield, have an if statement to show or hide this text input.
Will that work though if it is a required field? Even if the element is hidden the required will still not let them check out no?
Not sure what you mean by it not letting them check out, if you could explain that more.
But to what I said earlier, you can use the metafield to restrict this input field to just the products you want.
So I need a piece of data on a 2 certain products, all other products I do not need that text input, but the thing is that I need that piece of data to be required for those to products ie I can’t have them complete checkout without that data.
So my question was that even if I hide the the text input with a if statement the css would be to display: none; but on other products where that input was hidden, would the required part of the metafield still not be active since it is just hidden?
No, it wont be hidden as the metafield wont be active at all. You dont need to use a css solution for this, the if statement will check to see if the metafield is true, and if its not the input field won’t even be available in the HTML.