- This topic has 1 reply, 2 voices, and was last updated 2 days, 18 hours ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Stripe payment plugins for your WordPress site
· ·
Home › Forums › Stripe Payments Plugin › Payment Popup Window Related
Tagged: hooks
Is there a hook to add post data? I have a pricing calculator, and I want the button to add the total amount in the popup amount field automatically. Is that possible?
The price of a standard product can’t be modified dynamically in that way, as it will cause the security and verification process to fail.
It’s not an advertised feature of the plugin so code customization will be required for this.
The best options I can suggest for achieving a customized solution are:
Option 1:
Use a “Donation” type product (which allows any amount). In the payment popup window, you can add your own JavaScript code—using the available action and filter hooks—to perform calculations and update the amount field. The following hooks will let you add output (HTML, JavaScript, CSS) to the payment window:
If needed, additional hooks can be added.
Option 2:
Use the plugin’s feature for creating a payment button dynamically. With this method, you pre-calculate the amount and then embed or create a payment button with that calculated value. The plugin will generate a dynamic product, ensuring the price verification process does not fail.
Creating a Payment Button by Dynamically Adding Item Details in the Shortcode