
內容簡介
SHIFT64 Phone Validation for WooCommerce 是一款專為 WooCommerce 設計的外掛,能夠在結帳時檢查客戶輸入的電話號碼,確保其有效性並統一格式,提升訂單的準確性與可靠性。
【主要功能】
• 驗證結帳時的帳單及運送電話號碼
• 支援區域國家的電話格式
• 提供三種輸出格式:E.164、國際格式及國內格式
• 自動清理輸入的電話號碼
• 高亮顯示需要修正的電話欄位
• 兼容高效能訂單儲存 (HPOS)
外掛標籤
開發者團隊
② 後台搜尋「SHIFT64 Phone Validation for WooCommerce」→ 直接安裝(推薦)
原文外掛簡介
SHIFT64 Phone Validation for WooCommerce checks the phone numbers customers type at WooCommerce checkout. It rejects numbers that cannot exist in the customer’s country and can rewrite valid numbers into one consistent format before they are saved on the order. All checks run on your own server with the rules of Google’s open-source libphonenumber.
It checks that a number is valid. It does not send SMS messages or one-time codes, and it does not confirm that the customer owns the number.
Features
Validates the billing and shipping phone numbers when the order is placed. Empty fields are not checked; whether a phone is required stays a WooCommerce setting.
Works with both the block checkout (Store API) and the classic shortcode checkout.
Reads numbers in the context of the address country, so 600 123 456 with a Polish address is understood as +48 600 123 456.
Cleans up input first: spaces (including non-breaking spaces pasted from documents), hyphens, dots, slashes and parentheses are removed, and a leading 00 becomes +. Typographic dashes (–) are still rejected by WooCommerce’s own phone check.
Two validation modes: “Default country + international”, or “International only” (every number must include its country prefix, typed with + or 00).
Three output formats: E.164 (+48600123456), international (+48 600 123 456) and national (600 123 456). Formatting on save can be switched off.
Highlights the phone field that needs correcting.
Compatible with High-Performance Order Storage (HPOS) and the Cart and Checkout blocks.
English, Polish, German and formal German (Sie) translations.
Filters for developers.
Requires WordPress 7.1 or later and WooCommerce 7.2 or later.
What it does not do
It does not send SMS messages, one-time passwords or verification codes.
It does not call the number or confirm that the customer owns it or can be reached on it.
It does not look numbers up with carriers or any third-party service.
It does not add a country flag picker or an input mask to the phone field.
It does not check phone numbers outside the checkout, such as orders created or edited in the admin, or My Account addresses. Paying for an existing order through the Store API counts as checkout.
Privacy
The plugin makes no external HTTP requests and sends no data anywhere. Validation runs entirely on your server with rules bundled in the plugin. It sets no cookies and stores no personal data of its own, only its settings.
While validation is on, non-breaking and other Unicode spaces in a typed number become plain spaces. With “Enable Formatting on Save” on, the phone numbers of the order being placed are saved in the selected format; on the block checkout WooCommerce also copies them to the customer’s account. Nothing else is changed.
For developers
Filters: shift64_phone_validation_should_validate (skip a field or an order), shift64_phone_validation_formatted_phone (change the stored value), shift64_phone_validation_error_message (reword messages) and shift64_phone_validation_enqueue_assets (turn off the highlighting scripts). The helper Shift64\SmartPhoneValidation\format_phone() formats a number for your own code and returns null when it is not valid. Signatures and examples: developer documentation.
Formatting on save is on by default. Before going live, check every system that reads the order phone (exports, courier labels, SMS gateways): with E.164, 600 100 200 is stored as +48600100200.
Third-party library
Phone number rules come from libphonenumber-for-php-lite by Joshua Gigg, a PHP port of Google’s libphonenumber (Apache License 2.0), bundled with symfony/polyfill-mbstring (MIT). Neither connects to any external service. Apache 2.0 is compatible with GPLv3, so the plugin as a whole is distributed under the GPL through the “or later” clause.
Credits
Created and maintained by Mateusz Zadorożny at SHIFT64.
Sponsored by SHIFT64.
