WooCommerce Partial COD
Allow Cash on Delivery (COD) payment method only for selected products and categories in WooCommerce.
by Mehran Khan · github.com/mehrankhan38/woocommerce-partial-cod · 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-partial-cod/archive/refs/heads/main.zipWooCommerce Partial COD Plugin
A free WordPress plugin that allows Cash on Delivery (COD) payment method only for selected products and categories in WooCommerce.
Description
This plugin gives you control over which products or categories can use Cash on Delivery (COD) as a payment method. Instead of allowing COD for all products, you can now restrict it to specific products or categories only.
Features
- ✅ Restrict COD by specific products
- ✅ Restrict COD by product categories
- ✅ Support for both products OR categories (flexible restriction)
- ✅ Easy-to-use admin interface
- ✅ Works with product variations
- ✅ Lightweight and fast
- ✅ Free and open source
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/yourusername/woocommerce-partial-cod.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 Partial COD" and click "Activate"
-
Configure Settings
- Go to WooCommerce → Partial COD
- Select your restriction type:
- By Products: COD available only for selected products
- By Categories: COD available only for products in selected categories
- By Products OR Categories: COD available if cart has selected products OR products from selected categories
-
Select Products/Categories
- Choose the products or categories that should allow COD payment
- Click "Save Settings"
-
Test
- Add products to cart
- Go to checkout page
- COD payment method will only appear if cart contains allowed products/categories
How It Works
- When a customer adds products to cart and proceeds to checkout, the plugin checks if the cart contains any allowed products or products from allowed categories
- If the cart matches the criteria, COD payment method is shown
- If the cart doesn't match, COD payment method is hidden
Screenshots
Admin Settings Page
The plugin provides an intuitive admin interface where you can easily select products and categories.
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
- Support for product-based restrictions
- Support for category-based restrictions
- Support for combined (products OR categories) restrictions
- Admin settings page
License
This plugin is licensed under the GPL v2 or later.
Copyright (C) 2024
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.