How can I post custom HTML form data to the cart without product ID?


A

I build a separate page for my customer where no product renders, or in simple words the page is just a custom html, css and js only, independent from shopify.
It is a kind of simple form, where one can define text with font-style, color size and such other information and then send that information to cart for further process.

I tried everything to post the form’s data to cart but failed.
As my this page is independent, I think cart need variance id or product id to store information which I don’t have.

My actual query is that how can I bypass such (product’s) data and allow user to add there information to cart.

Kind Regards.

Makhdoom.

Hi @Makhdoom ,

You cannot add to cart without variant id, this is required. Please check at: https://shopify.dev/api/ajax/reference/cart

Hope this helps.

If you find my answer helpful for you. Please mark it as a solution.

Hi

I some how managed to pass the custom data but I am unable to pass the calculated money to the cart.

Hope you will get some Idea.

Kind regards.