#error!

The code you’ve added looks valid and in the right place, however, most themes now add to cart via JS rather then via form submission.

It is possible that this JS code does not submit entire form content, but, say only variant id and quantity values – hard to say without seeing the storefront.

And the rest of the form data is ignored…

It would help if you can share a linkto your product page (preview link, if not yet published).