How to show selected pickup point in order notifications?
To show pickup point information in your email notifications, follow these steps to modify the notification template.
- Navigate to Settings > Notifications > Customer notifications
- Select Order confirmation
- Click Edit code
Find this line in your template:
{{ shipping_address | format_address }}
Replace it with following:
{% if shop.metafields.atlas_pickup_points.rate_names contains shipping_method.title %} {% assign pickup_point = metafields.atlas_pickup_points.point %} {% if pickup_point %} <p> {{ pickup_point.details.name }} - {{ pickup_point.code }} <br/> {{ pickup_point.address.address1 }} <br/> {{ pickup_point.address.zip }} {{ pickup_point.address.city }} <br/> {{ shipping_address.country }} </p> {% else %} Check order details page for pickup point address {% endif %}{% else %} {{ shipping_address | format_address }}{% endif %}
Repeat the same for other order notifications (like Shipping confirmation, Order cancelled etc.).
Test your changes by creating test orders with both pickup point and regular shipping to verify notifications display correctly.
How it works
The code follows this logic:
-
First, checks if the shipping method matches any pickup point configuration
- Uses
contains
to search within our configuration metafield
- Uses
-
If there is a match:
- Retrieves the pickup point data from our pickup point metafield
- If pickup point data exists:
- Shows the pickup point details (name, code, address)
- If no pickup point data:
- Doesn’t show any address to avoid confusion
-
If there is no match:
- Falls back to displaying the standard shipping address
- Uses the default
format_address
filter
This change allows order notifications to dynamically show pickup point information when applicable.