# Dynamic Tag PHP

{% hint style="danger" %}
This feature requires the Elementor Pro license
{% endhint %}

### Inserting a PHP Dynamic Tag in Payment Fields

Follow these steps to implement a dynamic PHP tag in your payment form:

1. Create an Elementor form and add your desired payment field (such as credit card).

<figure><img src="/files/5dgPaDjaIkXGbqLeQ47t" alt=""><figcaption></figcaption></figure>

2. 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.
3. 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.

<div align="left"><figure><img src="/files/xf6ClE4CUYiy8c95bh6n" alt=""><figcaption></figcaption></figure></div>

4. Click the gear (settings) button to write your PHP code. Ensure that your code returns a numeric value representing the final quantity. For example:

```
return 2*5;
```

<div align="left"><figure><img src="/files/Bg8hlPBJd2fJ7VN3Eow2" alt=""><figcaption></figcaption></figure></div>

### Testing Your Dynamic Tag

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.

<figure><img src="/files/H7jv7aJB1DjxO8bE7Q20" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/B59oDeoj7EDhHR4v0Cd3" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payaddons.com/dynamic-tag-php.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
