I would like to retrieve a list of all commerce customer addresses except for one. When working with entries, this can be done with the {id: 'not ' ~ some.id }
parameter. This doesn't seem to work with craft.commerce.customer.addresses
.
I'm currently achieving what I need with the following code:
{% set customerAddresses = craft.commerce.customer.addresses %}
{% for address in customerAddresses %}
{% if address.id != craft.lhngroups.orgCommerceAddressId %}
output the address
{% endif %}
{% endfor %}
This works, but it throws off some {{ loop.index }}
operations I'm trying to perform since the actual array of addresses contains 1 more address than what I'm displaying.