A space to discuss online store customization, theme development, and Liquid templating.
I know customer can pay a pending order by a checkout link in the invoice email.
But if customer never receive that invoice email, can I just put a pay-now button on the Order page?
Is there any liquid snippet to render that button?
Thank you.
Yes, you can add a pay-now button on the order page for customers who haven't received the invoice email. To render the button, you can use the following Liquid code snippet:
{% if order.financial_status == 'pending' %}
<a href="/checkout/{{order.token}}" class="btn">Pay Now</a>
{% endif %}
https://shopify.dev/docs/api/liquid/objects/order
token does not exist in order.
Paste this code in the order file to redirect to the checkout page.
{% if order.financial_status == 'pending' %}
<a href="{{ order.order_status_url }}" class="btn">Pay Now</a>
{% endif %}