New Woo brand announcement v2 | Feb 4, 2025

Added by Mahrie - https://woomarketingstudio.wordpress.com/2024/12/20/studio-request-logo-rollout-customer-comms/

Phone Number Validation

Requirements

↑ Back to top

Before installing the Phone Number Validation extension, ensure that your environment meets the following requirements:

  • WordPress: Version 6.0 or higher
  • WooCommerce: Version 7.0 or higher
  • PHP: Version 7.4 or higher
  • HTTPS: Recommended for secure data transmission

Setup and Installation

↑ Back to top

Follow these steps to install and activate the Phone Number Validation plugin on your WooCommerce store:

  1. Download the Plugin:
    • Download the plugin zip file from the official WooCommerce marketplace after purchase.
  2. Upload to WordPress:
    • Log in to your WordPress admin dashboard.
    • Navigate to Plugins > Add New.
    • Click on the Upload Plugin button.
    • Choose the plugin .zip file you downloaded and click Install Now.
  3. Activate the Plugin:
    • After installation, click the Activate Plugin button.
    • The plugin is now active and ready for configuration.
  4. Configure Plugin Settings:
    • Click on Settings to access the plugin’s settings panel; OR
    • Navigate to WooCommerce > Settings > Shipping > Phone Validation to access the plugin’s settings panel.

Usage

↑ Back to top

Plugin Settings Overview

The Phone Number Validation plugin provides a comprehensive settings panel within the WooCommerce Shipping settings. Here’s an overview of the available settings:

  1. Add Shipping Phone Field: Add a shipping phone number input field to the shipping form.
  2. Make Shipping Phone Required: Require customers to enter a shipping phone number. If disabled, the field will be optional.
  3. Initial Country: The initial country code displayed for customers without an account.
    • Default: US
  4. Supported Countries: Select the country codes that are allowed. Leave blank to allow all countries. Must include the initial country when set.
    • Default: All countries allowed.
  5. Preferred Countries: Countries that appear at the top of the dropdown list during checkout.
    • Default: USGB
  6. Show Country Codes: Display country codes and flags on the checkout phone field. De-selecting this checkbox only shows country flags.
  7. Allow Dropdown: Allow users to select their country from a dropdown menu.
  8. Exclude Countries: Select countries to exclude from the country dropdown.
  9. Enable Debug: Enable debug logging for phone number validation. Debub logs found at WooCommerce > Status > Logs

Classic Checkout

For stores using the classic WooCommerce checkout system, the Phone Number Validation plugin integrates seamlessly to enhance phone number fields. Here’s how it works:

  1. Enhanced Phone Fields:
    • The billing phone field is augmented with country flags and validation mechanisms.
    • If enabled, a separate shipping phone field is added to the shipping address form.
  2. Real-Time Validation:
    • As customers enter their phone numbers, the plugin validates the input in real time, ensuring correctness.
  3. Error Notifications:
    • If a phone number is invalid, an error message is displayed, and the customer is prompted to correct it before proceeding.
  4. Order Processing:
    • Validated phone numbers are saved to the order metadata, ensuring accurate customer information.

Block Checkout

For stores utilizing WooCommerce’s block-based checkout system, the Phone Number Validation plugin ensures compatibility and enhanced functionality:

  1. Integration with WooCommerce Blocks:
    • The plugin detects block-based checkout pages and initializes phone number validation accordingly.
  2. Error Messaging:
    • Each phone number field will show a dedicated notice on the exact nature of the error. Examples include:
    • Billing phone number has an invalid country code.
    • Billing phone number is too short.
    • Billing phone number is too long.
    • Billing phone is an invalid number.
    • If validation fails and the customer attempts to proceed, a checkout error message is displayed at the top of the checkout form.
  3. Disabling “Place Order” Button:
    • The “Place Order” button is disabled until all phone numbers are correctly validated, preventing incomplete or incorrect orders.