{% extends 'shop/_layouts/main' %} {% block main %} {% set addressId = craft.app.request.param('addressId') %} {% set redirect = craft.app.request.param('redirect') %} {% if not address is defined and addressId %} {% set address = craft.commerce.customers.customer.getAddressById(addressId) %} {% endif %}

{% if addressId %} Edit Address {% else %} Add a new address {% endif %}

{{ csrfInput() }} {% if redirect %} {{ redirectInput(redirect) }} {% else %} {{ redirectInput('shop/customer/addresses') }} {% endif %} {% if addressId %} {% endif %} {% include 'shop/_includes/addresses/form' %} {% set isPrimaryBilling = cart.customer.primaryBillingAddressId == addressId %} {% set isPrimaryShipping = cart.customer.primaryShippingAddressId == addressId %}

{% if redirect %} Cancel {% else %} Cancel {% endif %}
{% endblock %}