Address_create Form Options
The address_create Liquid form adds a new address. Two optional parameters let you control whether that address is saved to the user's address book, set on the current cart, or both.
Default behaviour
With no options, a successful address_create submission does two things:
Saves the new address to the user's saved addresses.
Sets the new address as the selected address on the current cart.
{% form 'address_create' %}
<!-- your address fields -->
<button type="submit">Save address</button>
{% endform %}Options
Option
Default
Effect when set to false
assign_to_user
true
The address is not saved to the user's saved addresses. It is only applied to the cart (see assign_to_cart). Use for a one-off delivery address the customer should not keep.
assign_to_cart
true
The address is not set as the selected address on the current cart. It is only saved to the user's address book. Use when you are collecting addresses for later, not for the order in progress.
Both options are independent, so you can set either or both.
Examples
Save the address to the user's account, but do not change the address selected on the current cart:
Apply the address to the current cart only, without adding it to the user's saved addresses (a one-off address):
Tips
If you set both
assign_to_user: falseandassign_to_cart: false, the form creates the address but applies it to neither the cart nor the address book, which is rarely what you want.These options only affect where the created address is applied. They do not change validation or the fields the form accepts.
Related
Liquid Forms (parent article)
Admin > Shipping > Addresses
Last updated