This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Start by creating a new PHP snippet. Paste your custom code into it and set it to run "everywhere". | |
2. Create a text field, set the type to "tel", and name the form field "phone". | |
3. Create a select field, set it to "manual input" (do not add any options), and name the form field "country". | |
4. Create a hidden field named "full_phone_number" for storing the full phone number. | |
5. Create another hidden field named "full_country_name" for storing the full country name. | |
6. Add both hidden fields to the "Post Submit Action" section under "Content". | |
7. Update the page slug name to the specific page where you have added the form. For instance, if | |
the current page slug name is "contact", change it to match the URL of the page where the form is placed. | |
8. Finally, register for an account at https://ipinfo.io/signup ,to obtain a token key. Then, | |
integrate the token into your fetch request as follows: fetch('https://ipinfo.io?token=YOUR_TOKEN_KEY_HERE'). |