I’ve replaced our order confirmation notification using the Klaviyo Shopify template however I would like to include the last 4 digits of the card used + the card company logo like on the default notification however I am having issues extracting out of the original. Does anybody know how I can do this and paste it into my current notification
tim_1
March 26, 2024, 1:31am
2
Hey, this seems to be the relevant part of default notification:
{% for transaction in transactions %}
{% if transaction.status == "success" or transaction.status == "pending" %}
{% if transaction.kind == "capture" or transaction.kind == "sale" %}
{% if transaction.payment_details.gift_card_last_four_digits %}
ending with {{ transaction.payment_details.gift_card_last_four_digits }}
{% elsif transaction.payment_details.credit_card_company %}
ending with {{ transaction.payment_details.credit_card_last_four_digits }}
{% elsif transaction.gateway_display_name == "Gift card" %}
ending with {{ transaction.payment_details.gift_card.last_four_characters | upcase }}
Gift card balance - **{{ transaction.payment_details.gift_card.balance | money }}**
{% elsif transaction.gateway_display_name != "Shop Cash" %}
{{ transaction.gateway_display_name }}
{% endif %}
{% elsif transaction.kind == "authorization" and transaction.gateway_display_name == "Shop Cash" %}
Shop Cash - **{{ transaction.amount | money }}**
{% endif %}
{% endif %}
{% endfor %}
Covers all kinds of payment options, but if to cover credit cards only, then can be reduced to:
{% for transaction in transactions %}
{% if transaction.status == "success" or transaction.status == "pending" %}
{% if transaction.kind == "capture" or transaction.kind == "sale" %}
{% if transaction.payment_details.credit_card_company %}
ending with {{ transaction.payment_details.credit_card_last_four_digits }}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}