WooCommerce Discount Manager
A powerful WordPress plugin for managing WooCommerce product discounts via CSV upload or category selection, with bulk operations support.
by Vytautas Gluoksnis, SOUR advertising · github.com/gluoksnis/woocommerce-discount-manager · 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/gluoksnis/woocommerce-discount-manager/archive/refs/heads/main.zipA powerful WordPress plugin for managing WooCommerce product discounts via CSV upload or category selection, with bulk operations support.
Features
- Bulk Discount Management: Apply discounts to multiple products via CSV upload or by category
- Scheduled Discounts: Set start and end dates for discount campaigns
- Bulk Operations: Remove discounts from multiple products at once
- Category Filtering: Filter discounted products by category
- SKU Tag Assignment: Assign product tags based on SKU or category
- WPML Support: Automatic synchronization across all language versions (English, Lithuanian, etc.)
- Batch Processing: Handles thousands of products without timeouts
- Cloudflare Cache Integration: Optional cache purging after discount operations
- Safe Operations: Skip products with existing discounts option
Requirements
- WordPress 5.8 or higher
- WooCommerce 5.0 or higher
- PHP 7.4 or higher
Installation
From GitHub
- Download the plugin from GitHub
- Upload the
woocommerce-discount-managerfolder to the/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Navigate to the "Nuolaidos" menu in WordPress admin
Manual Installation
- Clone this repository:
git clone https://github.com/gluoksnis/woocommerce-discount-manager.git - Upload to
/wp-content/plugins/ - Activate in WordPress
Usage
Adding Discounts
- Navigate to Nuolaidos in WordPress admin
- Choose one of two methods:
- CSV Upload: Upload a CSV file with SKU codes (one per line)
- Category Selection: Select a product category from dropdown
- Enter discount percentage (1-100%)
- Set start and end dates (optional)
- Check "Skip products with existing discounts" if needed
- Check "Clear Cloudflare cache" if you have Cloudflare integration
- Click "Update Prices"
Viewing Discounted Products
- Navigate to Nuolaidos → Prekės su nuolaida
- View all products with active discounts
- Filter by category using the dropdown
- Use bulk actions to remove discounts from multiple products
- See discount schedules for each product
Removing Discounts
- Navigate to Nuolaidos → Ištrinti nuolaidas
- Choose one of three methods:
- CSV Upload: Upload a CSV with SKUs to clear
- Category Selection: Clear discounts from specific category
- Clear All: Remove all discounts from all products
- Check "Clear Cloudflare cache" if needed
- Click "Update Prices"
SKU Tag Assignment
- Navigate to Nuolaidos → Priskirti TAG
- Choose method (CSV or Category)
- Select the tag to assign
- Click "Assign Product Tags"
CSV Format
CSV files should contain one SKU per line:
SKU001
SKU002
SKU003
Cloudflare Integration
If you have a Cloudflare plugin installed that provides a flush_cloudflare_cache() function, you can optionally purge the cache after discount operations by checking the "Clear Cloudflare cache" checkbox.
WPML Multilingual Support
The plugin includes full WPML compatibility for multilingual WooCommerce stores:
- Automatic Detection: Detects WPML and identifies original language products
- Cross-Language Sync: Applies discounts to all language versions automatically
- One-Time Operation: Apply discounts once, works across all languages
- Price Consistency: Ensures consistent pricing across English, Lithuanian, and all other languages
How It Works
When you apply a discount in any language (e.g., Lithuanian admin):
- Plugin finds the original language product (usually English)
- Retrieves all translation IDs (English, Lithuanian, German, etc.)
- Applies discount to ALL translations automatically
- Result: Consistent prices across all languages
No more manual work per language! See WPML-GUIDE.md for detailed documentation.
Batch Processing
For stores with thousands of products, the plugin includes intelligent batch processing:
- Automatic Activation: Engages for 100+ products
- Progress Tracking: Shows processing status and estimated time
- No Timeouts: Handles 10,000+ products reliably
- Server Friendly: Processes in batches of 50 with small pauses
- Error Recovery: Continues processing even if individual products fail
Example: Processing 1,500 products across 3 languages (4,500 total operations) completes in ~90 seconds.
Filters and Hooks
The plugin uses standard WordPress and WooCommerce hooks. No custom filters are currently exposed, but you can extend the classes as needed.
Product Meta Fields
The plugin uses the following custom meta fields:
_nuolaida_pr: Stores the discount percentage- Standard WooCommerce fields:
_sale_price,_sale_price_dates_from,_sale_price_dates_to
Security
- All forms use WordPress nonces for CSRF protection
- User capabilities are checked (requires
manage_options) - All inputs are sanitized and escaped
- SQL queries use prepared statements
Translation
The plugin is translation-ready with the text domain wc-discount-manager. Lithuanian translations are included by default.
Support
For issues, questions, or contributions, please visit:
Changelog
1.0.0
- Initial release
- Bulk discount management via CSV or category
- Scheduled discounts
- Product list with filtering
- Bulk discount removal
- SKU tag assignment
- Cloudflare cache integration
License
GPL v2 or later - https://www.gnu.org/licenses/gpl-2.0.html