Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Some of our clients have multiple addresses on their account, and I'm looking to create a simple way for them to select which address to use on checkout from the cart page, rather than going back to account > addresses for every purchase.
My idea is to use a radio button group for the customer's addresses, but I'm not sure how to translate the selected address to the customer object and actually change the default address, or how to use the selected address for checkout.
Here is the code I've injected into the cart page so far:
{% if customer and customer.addresses_count > 1 %}
<div class="address-select">
<h4>Select Address</h4>
<form class="address-select-form">
{% for address in customer.addresses %}
<div class="radio-select">
<label for="{{ address.name }}-{{ forloop.index }}">
{{ address.name }}
</label>
<input
type="radio"
name="addresses"
id="{{ address.name }}-{{ forloop.index }}"
value="{{ address }}"
{% if address == customer.default_address %}
checked
{% endif %}
>
</div>
{% endfor %}
</form>
</div>
{% endif %}
Your html form isn't submitting to anything.
Just reference the customer address form tag in the theme , replicate it then pare it down to the minimum needed.
Also see the docs https://shopify.dev/docs/themes/architecture/templates/customers-addresses
If you need this customization done for you then contact me by mail for services.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Contact info in signature.
Good Hunting.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025