PayPal buy button using their javascript

I want to implement PayPal onto a checkout page and it seems the easiest way is using their javascript code found here:

https://developer.paypal.com/docs/business/checkout/set-up-standard-payments/

This works as expected with hard-coded price but I can’t seem to set the value from a variable. What’s the syntax I should be using?

Community Page
Last updated: