Skip to content
Advertisement

Woocommerce custom shortcode returns zero value

I have created a custom Thank you page in wordpress which has this paragraph:

Thank you so much for your order!

After paying off [cart_total] via XYZ website, please fill out this form and inform us about your payment.

And tried this custom shortcode:

JavaScript

But when I check out orders the output returns zero value for Total Price :

Thank you so much for your order!

After paying €0.00 via XYZ website, please fill out this form and inform us about your payment.

Advertisement

Answer

See comment from @xhynk why your code is not going to work.

Get last order (and order total) by user id

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement