Requirements
- WordPress 5.0 or higher
- WooCommerce 5.0 or higher
- PHP 7.4 or higher
- MySQL 5.6 or higher, OR MariaDB 10.1 or higher
Automatic installation
Automatic installation is the easiest option -- WordPress will handle the file transfer, and you won’t need to leave your web browser. To do an automatic installation of Shipping Class By Category For Woocommerce, log in to your WordPress dashboard, navigate to the Plugins menu, and click “Add New.”
In the search field type “Shipping Class By Category For Woocommerce” then click “Search Plugins.” Once you’ve found us, you can view details about it such as the point release, rating, and description. Most importantly, of course, you can install it by clicking “Install Now,” and WordPress will take it from there.
Manual installation
Manual installation method requires downloading the Shipping Class By Category For Woocommerce plugin and uploading it to your web server via your favorite FTP application. The WordPress codex contains
instructions on how to do this here.
1.3.0
- Fix: Shipping class now updates automatically when an existing product is moved to a different category. Previously the automatic assignment only ran on newly created products and was silently skipped for any update, so category reassignments had no effect.
- Fix: Resolved a timing issue where WooCommerce would overwrite the newly assigned shipping class with the stale form value during the same save request. The plugin now uses a two-phase approach — resolving the correct class early in the save cycle and writing it after WooCommerce has finished, so the final value is always correct.
- Improvement: New-product and category-change handling now share the same resolution logic via a single private helper, so parent-inheritance behaviour is identical in both cases and future changes only need to be made in one place.
- New: Added plugin-specific debug logging. When
WP_DEBUG, WP_DEBUG_LOG, and SCBCFW_DEBUG are all set to true in wp-config.php, the plugin writes step-by-step entries to /wp-content/debug.log (prefixed [SCBCFW]) covering category detection, shipping class resolution, and final assignment. See the Debug Mode section for details.
- Note: Existing behavior for new products and bulk assignment is unchanged.
1.2.0
- New Feature: Subcategory support - when enabled, bulk assignment also updates products in subcategories that have no shipping class of their own. Subcategories with an existing shipping class assignment are always skipped.
- New Feature: Confirmation prompt shown before processing, listing affected subcategory names, so no products are updated by surprise
- New Feature: Parent category inheritance for new products - option to walk up to parent categories if a new product's direct category has no shipping class assigned
- New Feature: Hierarchical category dropdown - categories now display in parent → child tree format (with indentation) for easier navigation in large stores
- New Feature: Optional shipping class column in the WooCommerce product categories table
- Settings: New option added to enable/disable the categories table column (disabled by default)
- Settings: Two new options added to the Settings page to control subcategory and parent inheritance behavior (both disabled by default to preserve existing behavior)
- Improvement: JavaScript refactored to support subcategory confirmation flow before batch processing begins
- Note: All new options are opt-in and disabled by default - existing behavior is unchanged unless you enable them
1.1.0
- UX Improvement: Categories are now sorted alphabetically in both the assignment dropdown and overview table
- Better Organization: Makes it easier to find specific categories in large stores
- Security Improvements: Enhanced nonce verification and input validation
- Code Quality: Refactored code structure with proper separation of concerns
- Documentation: Added comprehensive PHPDoc blocks and inline comments
- Error Handling: Improved error handling and user feedback
- Performance: Optimized database queries and batch processing
- Standards: Updated to follow WordPress coding standards
- Fixed JavaScript and CSS enqueuing
- Improved batch processing stability
1.0.3
Woocommerce required check added.
1.0.2
JavaScript and Style CSS are enqueued.
1.0.1
- Shipping Class assignment using Batch (Ajax basis) so server timeout does not happen on low memory servers if there are too many products in a category.
1.0.0
Frequently Asked Questions
Q: How do I enable debug logging for this plugin?
A: Add all three lines below to your
wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'SCBCFW_DEBUG', true );
All three must be present.
SCBCFW_DEBUG is the plugin-specific flag that keeps plugin logs separate from general WordPress debug output. Once enabled, detailed entries are written to
/wp-content/debug.log with the prefix
[SCBCFW], showing exactly which category and shipping class were evaluated for each product. Disable
SCBCFW_DEBUG (or remove it) on production sites when you are done troubleshooting.
Q: If I move a product to a different category, does its shipping class update automatically?
A: Yes, as of version 1.3.0. When you save a product under a new category, the plugin detects the category change and applies the shipping class assigned to the new category. If the new category has no shipping class and the "Inherit Parent Category" setting is enabled, the plugin walks up to the nearest parent category that has one.
Q: Can I assign different shipping classes to individual products within a category?
A: Yes! First assign the desired shipping class to the category, then manually edit individual products that need different shipping classes.
Q: Can I assign shipping classes to product variations?
A: Currently, this functionality is not available. It may be added in future versions.
Q: What happens if I have thousands of products in a category?
A: The plugin uses batch processing to handle large numbers of products efficiently. It processes products in small batches (default: 25) to prevent server timeouts.
Q: Is this plugin compatible with my theme?
A: Yes, this plugin works with any WordPress theme that supports WooCommerce.
Support
For support, feature requests, or bug reports, please visit the
plugin support page.
License
This plugin is licensed under the GPL v2 or later.
Note: This plugin is designed to work with WooCommerce's standard shipping class system. For custom shipping solutions, additional configuration may be required.