Solved

"if has_pending_payment" in Order Confirmation is not working

DennisKwan
Tourist
5 0 2

There are, by default, the below payment status checking in the order confirmation template but it never goes to the true condition even the order is payment pending.  What makes the order confirmation going to the true condition?  Thanks.

{% capture email_title %}
{% if has_pending_payment %}
True True True
{% else %}
False False False
{% endif %}
{% endcapture %}
Accepted Solution (1)

rishi1897
Shopify Partner
53 3 5

This is an accepted solution.

has_pending_payment is a variable, please check if it used before in the same code(press ctrl+F) to search in the same code file,

 

if found share that piece of code here (will check the logic),

if not this is empty variable and will always be false,

 

thanks

View solution in original post

Replies 6 (6)

rishi1897
Shopify Partner
53 3 5

This is an accepted solution.

has_pending_payment is a variable, please check if it used before in the same code(press ctrl+F) to search in the same code file,

 

if found share that piece of code here (will check the logic),

if not this is empty variable and will always be false,

 

thanks

DennisKwan
Tourist
5 0 2

@rishi1897 I thought that's a system defined global var.  It is working fine now after defining has_pending_payment with checking order.financial_status.  Thank you very much for pointing me to the right path.

 

pawankumar
Shopify Partner
423 42 75

Hi @DennisKwan 
I hope you are doing well. has_pending_payment is a variable that denotes that payment status is pending. When the payment status for an order is Payment pending, then you might be restricted from editing, canceling, or manually collecting payment for the order. These restrictions can apply to orders where the customer paid using cryptocurrency, wire, barcodes, or other alternatives to credit card payments.
I am adding Shopify link here from these you can get better insights about it
https://help.shopify.com/en/manual/orders/notifications/email-variables
https://help.shopify.com/en/manual/orders/manage-orders/alt_payments_pending

Thank you!

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan
DennisKwan
Tourist
5 0 2

@pawankumar Thanks for the docs.  I found the order.financial_status fixing my needs.  Yeah.

 
Bogi2
Excursionist
17 1 1

Hi DennisKwan,

would you mind sharing your code solution?

I am facing the same issue.

thx,

Bogi

DennisKwan
Tourist
5 0 2

Hi Bogi,

 

I added the following lines at the very beginning of the order confirmation template.

 

{% if order.financial_status == 'pending' %}
  {% assign has_pending_payment = true %}
{% else %}
  {% assign has_pending_payment = false %}
{% endif %}

 

 

Cheers,

Dennis