WooCommerce Checkout Field Toggle
Easily hide or show specific checkout fields (Company, Phone, Address 2) in WooCommerce checkout page from admin settings.
by Mehran Khan · github.com/mehrankhan38/woocommerce-checkout-field-toggle · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/mehrankhan38/woocommerce-checkout-field-toggle/archive/refs/heads/main.zipA free WordPress plugin that allows you to easily hide or show specific checkout fields (Company, Phone, Address 2) in WooCommerce checkout page from admin settings.
Description
This lightweight plugin gives you complete control over the visibility of checkout fields. Instead of modifying code or using complex filters, you can now toggle the visibility of Company, Phone, and Address Line 2 fields with a simple dropdown in the admin panel.
Features
- ✅ Toggle Company field visibility (billing & shipping)
- ✅ Toggle Phone field visibility
- ✅ Toggle Address Line 2 field visibility (billing & shipping)
- ✅ Easy-to-use admin interface
- ✅ Instant effect after saving settings
- ✅ Lightweight and fast
- ✅ Free and open source
- ✅ Multisite compatible
Installation
Method 1: Manual Installation
- Download the plugin ZIP file from the Releases page
- Go to WordPress Admin → Plugins → Add New
- Click "Upload Plugin" and select the ZIP file
- Click "Install Now" and then "Activate"
Method 2: Git Clone
cd wp-content/plugins/
git clone https://github.com/mehran0038/woocommerce-checkout-field-toggle.git
Then activate the plugin from WordPress Admin → Plugins
Requirements
- WordPress 5.0 or higher
- WooCommerce 3.0 or higher
- PHP 7.2 or higher
Usage
-
Activate the Plugin
- Go to WordPress Admin → Plugins
- Find "WooCommerce Checkout Field Toggle" and click "Activate"
-
Configure Settings
- Go to WooCommerce → Checkout Field Toggle
- For each field (Company, Phone, Address 2), select:
- Show: Display the field on checkout page
- Hide: Hide the field from checkout page
-
Save Settings
- Click "Save Settings" button
- Changes take effect immediately
-
Test
- Go to your store's checkout page
- Verify that the fields are shown or hidden according to your settings
How It Works
- The plugin uses WooCommerce filters to modify checkout fields
- When you hide a field, it's completely removed from the checkout form
- Hidden fields won't be required for order completion
- Settings are stored in WordPress options and persist across updates
Supported Fields
- Company Field: Controls both billing and shipping company fields
- Phone Field: Controls the billing phone field
- Address Line 2: Controls both billing and shipping address line 2 fields (Apartment, suite, unit, etc.)
Screenshots
Admin Settings Page
The plugin provides a simple and intuitive admin interface where you can toggle field visibility with dropdown menus.
Support
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with details about your problem
- Include WordPress, WooCommerce, and PHP versions
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Changelog
1.0.0
- Initial release
- Toggle Company field visibility
- Toggle Phone field visibility
- Toggle Address Line 2 field visibility
- Admin settings page
- Multisite support
License
This plugin is licensed under the GPL v2 or later.
Copyright (C) 2024 Mehran Khan
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Credits
Developed with ❤️ for the WooCommerce community.
Author
Mehran Khan - Portfolio
Developed by Mehran Khan. Visit portfolio.gitxpert.com for more information.