matusstafura / magento2-phone-validation
Phone validation for Magento 2
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Open Issues: 0
Type:magento2-module
Requires
- php: >=8.1
- magento/framework: ^103.0.1
README
Problem: Magento 2 allows invalid characters in the phone number field:
Fresh Magento 2 installation:![]() |
Validation with Module:![]() |
This module adds phone number validation to key Magento 2 forms such as:
- 🛒 Checkout (shipping & billing address)
- 🧑 during Customer registration (todo)
📦 Installation (via Composer Path Repository)
- Install via composer(recommended)
composer require matusstafura/magento2-phone-validation
or clone this module to app/code/MatusStafura/PhoneValidation
:
git clone git@github.com:matusstafura/magento2-phone-validation.git
- Enable and compile module:
bin/magento module:enable MatusStafura_PhoneValidation bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:flush
- Enable / disable in Admin:
Stores > Configuration > Customers > Customer Configuration > Phone Validation
🤝 Contributing
Contributions are very welcome! If you'd like to improve the module, add features, fix bugs, or improve documentation:
- Fork the repository
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes and commit with clear messages
- Push to your fork:
git push origin feature/your-feature-name
- Open a pull request on GitHub
📃 License
MIT