has_pending_payment not working, always false

i am trying out the feature of sending order confirmation emails to customers after they place a purchase and when they have chosen manual payment, i believe the has_pending_payment value should be pending or true, but when i displayed it in an email it was false

it didnt make sense because i had set payment capture to manual, hence has_pending_payment should not be false until i marked the payment and paid right

and it is clearly unpaid yet as i can see in the order section, it still says payment pending

Screenshot 2025-02-24 at 10.30.02 PM.png

is anyone able to send order confirmation emails based on payment status?

Having the same question here. There is another thread from 2023 about the same topic but the replies are trash.

This is the documentation of the “has_pending_payment” variable, which is specifically used for email notifications: Payment status properties

That also links to the page about Pending payments from additional providers.

At the bottom, there is the info that “If an additional payment provider is using an older platform, then you aren’t prevented from modifying orders that have the Payment pending status.”, so I am assuming that Shopify internally distinguishes between two different types of “payment pending” and only the one where the payment gateway explicitly blocks the order (also in Shopify Admin) also sets the variable “has_pending_payment” to true.
If the customer selects e.g. bank transfer as the payment method, this is not the case, which makes that notification variable pretty useless.

The other thread also mentions an alternative way by checking the liquid variable order.financial_status == ‘pending’ and then overwriting the other one by assign has_pending_payment = true. Maybe this works, but I didn’t try it yet.

(Maybe the buyer_action_required variable also has to be set to true so that the email template uses the desired text.)

Thank you for this!

A customer had the bank transfer option option enabled and wanted to send payment details in the order confirmation email.

Per your suggestion, I ended up checking if the financial_status == ‘pending’

At the top of the template:

{% if financial_status == ‘pending’ %}
{% assign has_pending_payment = true %}
{% endif %}

The buyer_action_required variable still returned false, so we just put the payment details in the adjacent else block.

{% if buyer_action_required %}
You’ll receive an email confirmation after you complete the payment.
{% else %}
[Insert your payment details here]

Works like a charm.