Re: new address form not working on custom theme

new address form not working on custom theme

15 1 5

I am writing my own code to implement the "add new address form" on my theme.


I followed the docs here, but my form is not adding a new record upon submit.


Does adding addresses somehow not work on development stores? My edit address form is working, just not my add address form.


Both forms have almost the same code, except the {% form %} tag and the initial values inside each input. Below is an extract of my code


// snippets/address-form.liquid
<div class="address-form-container"> {% liquid if address assign form_arg = address assign address_id = else assign form_arg = customer.new_address assign address_id = 0 endif %} {% form 'customer_address', form_arg %} <label for="country-{{ address_id }}">
<select id="country-{{ address_id }}"></select>
// other code
// ... {% endform %}
Reply 1 (1)

15 1 5

resolved: my form was not sending the country parameter.


apparently shopify sends a 302 response even if the form is invalid, and just silently ignores the error