Przejdź do głównej zawartości

Jak dodać szczegóły punktu odbioru do wiadomości e-mail z potwierdzeniem zamówienia?

Dołączenie szczegółów punktu odbioru do wiadomości e-mail z potwierdzeniem zamówienia to doskonały sposób na zapewnienie klientom wyraźnego zapisu wybranej lokalizacji.


Dodawanie szczegółów punktu odbioru do wiadomości e-mail z potwierdzeniem

Dział zatytułowany „Dodawanie szczegółów punktu odbioru do wiadomości e-mail z potwierdzeniem”
  1. Przejdź do Ustawienia > Powiadomienia > Powiadomienia klientów w panelu administracyjnym Shopify.
  2. Wybierz Potwierdzenie zamówienia z listy powiadomień.
  3. Kliknij Edytuj kod.

  1. Znajdź: {{ shipping_address | format_address }}

  2. Zastąp następującym kodem:

{% assign PickupPoint = metafields.Globe.PickupPoint %}
{% assign globe_config = shop.metafields.globe.config %}
{% assign is_pickup_method = false %}
{% if PickupPoint and globe_config %}
{% assign order_country = shipping_address.country_code | downcase %}
{%- comment -%} Gather all shipping method titles into one lowercase haystack {%-endcomment-%}
{% assign method_titles = "" %}
{% if shipping_method.title %}
{% assign method_titles = shipping_method.title %}
{% endif %}
{% for sm in shipping_methods %}
{% assign method_titles = method_titles | append: "||" | append: sm.title %}
{% endfor %}
{% assign method_titles = method_titles | downcase | strip %}
{% for entry in globe_config %}
{% assign entry_name = entry.name | downcase | strip %}
{% assign entry_country = entry.country | downcase %}
{% if entry_name != "" and entry_country == order_country or entry_country == "all" %}
{% if entry_name != "" and method_titles contains entry_name %}
{% assign is_pickup_method = true %}
{% break %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% if PickupPoint and is_pickup_method %}
<p>
{{ PickupPoint.name }}
<br/>
{{ PickupPoint.addressObject.street }}
<br/>
{{ PickupPoint.addressObject.city }} {{ PickupPoint.addressObject.zip }}
<br/>
{{ shipping_address.country }}
</p>
{% else %}
{{ shipping_address | format_address }}
{% endif %}