Amazon payの配送先と請求先が同じになる不具合に関して下記記事を参考にコードをコピーして反映しました。
https://5-bit.jp/blogs/shopify/210925
注文完了ページに関しては記事の通り反映されたのですが、受注メールに関して受信の確認ができませんでした。
他の決済方法は通常通り受注メールの確認はとれています。
何か原因かわかりますでしょうか?
お世話になります。
株式会社5-bitの福水と申します。
この度は、弊社のブログ記事をご参照いただき、誠にありがとうございました。
問題の詳細を確認するために、お伺いしたいのですが、
注文完了ページに関しては記事の通り反映されたのですが、受注メールに関して受信の確認ができませんでした。
↑こちらの「受注メールに関して受信の確認ができなかった」というのは、どういった状態を指しているのでしょうか?
よろしければ、スクショなどでご教示いただけると幸いです。
ご確認の程、何卒よろしくお願い致します。
福永様
ブログ記載の企業様からのご返信すごく嬉しいです。
ありがとうございます。
受注メールに関してなのですが、記事の内容を検証するのにAmazon payでテスト購入を行なったのですが、受注メール自体が受信されませんでした。
他の決済の場合は通常通り受注メールを受信しております。
shopify様にも同時に相談したのですが、回答は得られませんでした。
少ない情報で申し訳ございませんがご教示いただけたら嬉しいです。
なるほど、ありがとうございます。
メールの受信自体ができないということは、カスタマイズが原因ではないように思えます。
問題の原因の切り分けをするために、お手数ですが、一度、メールテンプレートの中身を初期状態に戻した上で、再度AmazonPayのテスト注文を行ってみて、メールが届くかどうかご確認いただいてもよろしいでしょうか?
メールが届くかどうかにかかわらず、結果をまたここにご連絡いただければ、そこから何かしらご案内できるかもしれないです。
ご確認の程、何卒よろしくお願い致します。
ご回答ありがとうございます。
コードを変更する前はAmazonpay使用時も受注メールは届いておりました。
何かこちらで入れたコピーコードがおかしい可能性はありますでしょうか?
下記が御社の記事をみてコピーして、本番環境にいれたコードになります。
{% capture email_title %}ご購入いただきありがとうございました! {% endcapture %}
{% capture email_body %}
{% if requires_shipping %}
{% case delivery_method %}
{% when ‘pick-up’ %}
注文の受取の準備が整うと、メールが届きます。
{% when ‘local’ %}
{{ customer.last_name }}様、ご注文の品を配達する準備を行っております。
{% else %}
{{ customer.last_name }}様、ご注文いただき、誠にありがとうございます。注文の発送準備を行なっております。商品が発送されましたら、Eメールにてお知らせいたします。
{% endcase %}
{% if delivery_instructions != blank %}
配達情報: {{ delivery_instructions }}
{% endif %}
{% endif %}
{% endcapture %}
{{ email_title }}
.button__cell { background: {{ shop.email_accent_color }}; }
a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
{%- if shop.email_logo_url %}
{%- else %}
{%- endif %}
|
注文 {{ order_name }}
|
|
|
{{ email_title }}
{{ email_body }}
{% if order_status_url %}
| |
|
{% if shop.url %}
{% endif %}
|
{% else %}
{% if shop.url %}
{% endif %}
{% endif %}
|
|
{% assign gift_card_line_item = line_items | where: “gift_card” %}
{% if gift_card_line_item.first %}
{% endif %}
{% for line in subtotal_line_items %}
{% endfor %}
{% if line.image %}
{% endif %}
|
{% if line.product.title %}
{% assign line_title = line.product.title %}
{% else %}
{% assign line_title = line.title %}
{% endif %}
{% if line.quantity < line.quantity %}
{% capture line_display %} {{ line.quantity }} of {{ line.quantity }} {% endcapture %}
{% else %}
{% assign line_display = line.quantity %}
{% endif %}
{{ line_title }} × {{ line_display }}
{% if line.variant.title != ‘Default Title’ %}
{{ line.variant.title }}
{% endif %}
{% if line.selling_plan_allocation %}
{{ line.selling_plan_allocation.selling_plan.name }}
{% endif %}
{% if line.refunded_quantity > 0 %}
返金済み
{% endif %}
{% if line.discount_allocations %}
{% for discount_allocation in line.discount_allocations %}
{% if discount_allocation.discount_application.target_selection != ‘all’ %}
![]()
{{ discount_allocation.discount_application.title | upcase }}
(-{{ discount_allocation.amount | money }})
{% endif %}
{% endfor %}
{% endif %}
|
{% if line.original_line_price != line.final_line_price %}
{{ line.original_line_price | money }}
{% endif %}
{% if line.final_line_price > 0 %}
{{ line.final_line_price | money }}
{% else %}
無料
{% endif %}
|
|
|
{% for discount_application in discount_applications %}
{% if discount_application.target_selection == 'all' %}
{% capture discount_title %}
{% if discount_application.title %}
{{ discount_application.title | upcase }}
{% else %}
ディスカウント
{% endif %}
{% endcapture %}
{% endif %}
{% endfor %} {% if delivery_method == ‘pick-up’ %} {% else %} {% endif %} {% if current_total_duties %} {% endif %} {% if total_tip and total_tip > 0 %} {% endif %}
|
ディスカウント
{{ discount_title }}
|
-{{ discount_application.total_allocated_amount | money }}
|
|
小計
|
{{ subtotal_price | money }}
|
|
受取
|
{{ shipping_price | money }}
|
|
配送
|
{{ shipping_price | money }}
|
|
関税
|
{{ current_total_duties | money }}
|
|
税金合計
|
{{ tax_price | money }}
|
|
Tip
|
{{ total_tip | money }}
|
|
合計
|
{{ total_price | money_with_currency }}
|
{% if total_discounts > 0 %}
割引 {{ total_discounts | money }}
{% endif %}
{% assign transaction_size = 0 %}
{% assign transaction_amount = 0 %}
{% for transaction in transactions %}
{% unless transaction.kind == “capture” or transaction.kind == “void” %}
{% assign transaction_size = transaction_size | plus: 1 %}
{% assign transaction_amount = transaction_amount | plus: transaction.amount %}
{% endunless %}
{% endfor %}
{% if transaction_size > 1 or transaction_amount < total_price %}
{% for transaction in transactions %}
{% if transaction.status == “success” and transaction.kind == “authorization” or transaction.kind == “sale” %}
{% if transaction.payment_details.credit_card_company %}
{% capture transaction_name %}{{ transaction.payment_details.credit_card_company }} (カード番号下4桁: {{ transaction.payment_details.credit_card_last_four_digits }}){% endcapture %}
{% else %}
{% capture transaction_name %}{{ transaction.gateway_display_name }}{% endcapture %}
{% endif %} {% endif %}
{% if transaction.kind == ‘refund’ %}
{% if transaction.payment_details.credit_card_company %}
{% assign refund_method_title = transaction.payment_details.credit_card_company %}
{% else %}
{% assign refund_method_title = transaction.gateway %}
{% endif %} {% endif %}
{% endfor %}
|
|
|
{{transaction_name}}
|
{{ transaction.amount | money }}
|
|
返金
{{ refund_method_title | capitalize }}
|
- {{ transaction.amount | money }}
|
{% endif %}
|
|
|
{% if requires_shipping and shipping_address %}
{% endif %}
{% if billing_address %}
{% endif %}
配送先住所
{{ shipping_address | format_address }}
|
請求先住所
{% assign isAmazonPay = false %}
{% for transaction in transactions %}
{% if transaction.status == "success" or transaction.status == "pending" %}
{% if transaction.kind == "authorization" or transaction.kind == "sale" %}
{% if transaction.gateway_display_name == "Amazon Pay" %}
{% assign isAmazonPay = true %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% if isAmazonPay %}
Amazon Payにご登録の住所です。
{% else %}
{{ billing_address | format_address }}
{% endif %}
|
{% if requires_shipping and shipping_address %}
{% endif %}
{% assign transaction_count = transactions | size %}
{% if transaction_count > 0 %}
{% endif %}
配送方法
{{ shipping_method.title }}
|
決済方法
{% for transaction in transactions %}
{% if transaction.status == "success" or transaction.status == "pending" %}
{% if transaction.kind == "authorization" or transaction.kind == "sale" %}
{% if transaction.payment_details.credit_card_company %}
{{ transaction.payment_details.credit_card_last_four_digits }}で終わる — {{ transaction.amount | money }}
{% elsif transaction.gateway_display_name == "Gift card" %}
{{ transaction.payment_details.gift_card.last_four_characters | upcase }}で終わる — {{ transaction.amount | money }}
ギフトカード残高: {{ transaction.payment_details.gift_card.balance | money }}
{% else %}
{{ transaction.gateway_display_name }} — {{ transaction.amount | money }}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
|
|
|
![]()
|
ありがとうございます。
繰り返しになってしまい、大変恐縮なのですが、問題の切り分けをするために、一度、メールテンプレートの中身を初期状態に戻した上で、再度AmazonPayのテスト注文を行ってみて、メールが届くかどうかご確認いただいてもよろしいでしょうか?
ご返答ありがとうござます。
一度、変更前の状態に戻しメールの受信確認を行なってみます。
お世話になっております。
メールのテンプレートを戻してテストしたところ以前のように受信の確認がとれました。
何か問題解決の糸口がございますでしょうか?
五月雨式に質問してしまい申し訳ございません。
・注文確認メール
・注文編集メール
の2点に関して
Amazon Payにご登録の住所です。
を表示するのに必要なコードだけ抜粋いただければ解決できそうな気もするのですが、いかがでしょうか?
本当にお手数かけてしまい申し訳ないですがお力添えいただけると助かります!
お世話になります。
該当の文言を出力するための記述は、下記の通りです。
{% assign isAmazonPay = false %}
{% for transaction in transactions %}
{% if transaction.status == "success" or transaction.status == "pending" %}
{% if transaction.kind == "authorization" or transaction.kind == "sale" %}
{% if transaction.gateway_display_name == "Amazon Pay" %}
{% assign isAmazonPay = true %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% if isAmazonPay %}
Amazon Payにご登録の住所です。
{% else %}
{{ billing_address | format_address }}
{% endif %}
ご確認のほど、よろしくお願いします!