Product form add to cart redirect to custom url

Hi all

Long story short I have a custom product form for various reasons (adding custom line items etc).

Without using AJAX or Fetch is it possible to get the product form ‘add to cart’ button to redirect the user to a different url than the default cart url?

I’d like to redirect the user based on a line item selection (I can handle that separately).

My question is, is it possible using the native add to cart functionality, to direct the user to a custom url instead of /cart (or if not even a add a url parameter so I can then set-up a redirect)?

{%- form 'product', product -%}

<!-- product variants and line item fields -->

<!-- By default this goes to /cart I want it to add the product but go to a different url (not /cart) before I can then direct them to the cart manually via a link on my new page -->
<input type="submit" value="Add to cart">

{% endform %}

return_to

Hi @Matt24

Use the hard to discover return_to to redirect forms to pages other than the form destination parameter either as an html form input, or as a liquid form tag parameter

https://shopify.dev/docs/themes/architecture/templates/customers-login#redirect-customers-on-login

Note: for permalinks there is the storefront=true parameter

https://shopify.dev/docs/apps/checkout/cart-permalinks/cart-permalinks#step-6-optional-redirect-to-the-online-store-cart-instead-of-checkout

Perfect thanks Paul.