I have the following code that works when adding a product to a cart in theme editor, but not when I test it out in preview. Any thoughts?
<form method="post" action="/cart" >
<input type="number" name="updates" onfocus="this.select()" value="1">
<input value="ORDER NOW" type="submit" />
Solved! Go to the solution
This is an accepted solution.
I was able to get it working. The cart URL has different structures for both theme editor and preview. To get my code working, I had to explicitly define the cart path for the preview URL within the form action.
<form method="post" action="//xyz.myshopify.com/cart" ...>