Customer Address Management

When a customer checks out with a new address, the address is added to their address book.

If the customer is a guest, they have no need to manage an address book.

Customers can only add and remove addresses from the front-end while they are logged in.

Get all addresses belonging to the current customer. #

{% addresses = craft.commerce.customer.addresses %}
{% for address in addresses %}
  {address.firstName}<br/>
  ...
{% endfor %}

See the Address Model to learn about the fields available on an address.

Updating or creating a new a customers address #

<form method="post">
  <input type="hidden" name="action" value="commerce/customerAddresses/save">
  <input type="hidden" name="redirect" value="commerce/customer/addresses">
  <input type="text" name="address[firstName]" value="{{ address ? address[firstName] : '' }}">
  <input type="text" name="address[lastName]" value="{{ address ? address[lastName] : '' }}">
  ...
  <input type="submit" value="Save"/>
</form>

Including an address[id] param with a valid address ID that belongs to the current customer will update that address.

Deleting a customers address #

<form method="POST">
  <input type="hidden" name="action" value="commerce/customerAddresses/delete">
  <input type="hidden" name="redirect" value="commerce/customer/addresses">
  <input type="hidden" name="id" value="{{ address.id }}"/>
  <input type="submit" value="delete"/>
</form>

If you delete an address that is currently applied as the billing or shipping address of the current customers cart, will result in the addresses on the cart being removed.

Buy Craft Commerce

Craft Commerce site license

Includes

  • Developer support
  • One year of updates ($199/year for updates after that)
  • Craft Pro site license
Buy now for $999
Can I try before buying?

Absolutely. Just download it from the “Download” button in the site header and follow our installation instructions. You’ll have the full feature set to experiment with, without any restrictions, as long as you’re running it from a development, testing, or staging domain.

Will there be recurring/upgrade fees?

Each Commerce license comes with one year of updates. After that, you can unlock additional updates for $199 per year.

Can I use this on an existing Craft site?

Yes! And if you already have a Craft Pro license (or you don’t need one), you can purchase Craft Commerce directly from the Plugin Store or just leave the switch off that says “Include a Craft Pro license” in the purchase form.

Is Craft Pro required?

Craft Commerce does not require Craft Pro; it works perfectly fine on Craft Solo as well!

Can I try before buying?

Absolutely. Just download it from the “Download” button in the site header and follow our installation instructions. You’ll have the full feature set to experiment with, without any restrictions, as long as you’re running it from a development, testing, or staging domain.

Will there be recurring/upgrade fees?

Each Commerce license comes with one year of updates. After that, you can unlock additional updates for $199 per year.

Can I use this on an existing Craft site?

Yes! And if you already have a Craft Pro license (or you don’t need one), you can purchase Craft Commerce directly from the Plugin Store or just leave the switch off that says “Include a Craft Pro license” in the purchase form.

Is Craft Pro required?

Craft Commerce does not require Craft Pro; it works perfectly fine on Craft Solo as well!