Dynamic Tag PHP
When pricing or quantity requires complex calculations, our Dynamic Tag feature lets you run PHP code directly within payment fields.
Last updated
When pricing or quantity requires complex calculations, our Dynamic Tag feature lets you run PHP code directly within payment fields.
Last updated
This feature requires the Elementor Pro license
Follow these steps to implement a dynamic PHP tag in your payment form:
Create an Elementor form and add your desired payment field (such as credit card).
In the "Actions After Submit" list, add "Credit Card Submission". This will display the Credit Card Submission tab where all your payment settings are located.
Click on the Amount field's dynamic tag button, then scroll down the list of available tags until you find "Code(php)" in the Elementor Stripe Addons category.
Click the gear (settings) button to write your PHP code. Ensure that your code returns a numeric value representing the final quantity. For example:
With the configuration shown above, you can see how dynamic values affect your payment processing:
The amount is fixed at âŦ19.90
The quantity is dynamically calculated by our PHP code, which returns a value of 10
Therefore, the total price charged would be âŦ199.00 (âŦ19.90 Ã 10)
This feature gives you powerful flexibility when dealing with complex pricing scenarios in your Elementor forms.