Variable Price is an add-on for the WP Stripe Checkout plugin that can be used to add a price field to your Stripe payment buttons. This lets buyers set the amount they will pay for your products. It can also be used for accepting Stripe donation payments.
You can enable variable pricing in the product interface of the Stripe checkout plugin.
Once you have created a new product or edited an existing one with this option enabled, add the shortcode for it to a post/page.
Replace the value of id with your product ID.
When the button for this product is rendered on the front end, a price input field will appear that will let buyers set the amount they want to pay.
The default label for the price field (Amount) can be customized in the add-on settings (Stripe Checkout > Variable Price).
If you are using the “wp_stripe_checkout_session” shortcode in the Stripe Checkout plugin, you can change it to the following to enable variable pricing.
[wp_stripe_checkout_session name="My Product" price=""]
Leaving the price parameter empty implies that you wish to let buyers enter a custom amount for this item.
Get the Variable Price Add-on
Please contact us if you have any questions about the add-on.
2 thoughts on “How to Add a Price Field to a Stripe Payment Button”
Can I change the label?
@Robert, Yes, you can customize it in the add-on settings.