WooHSN is a comprehensive WordPress plugin that provides smart HSN (Harmonized System of Nomenclature) code management for WooCommerce stores. Automate GST readiness with minimal effort and simplify tax compliance for Indian businesses.
- Easy HSN Code Assignment - Add HSN codes to products effortlessly through an intuitive interface
- Product Integration - Seamless integration with WooCommerce products
- GST Rate Management - Automatically calculate and display GST rates based on HSN codes
- Bulk Operations - Assign HSN codes to multiple products at once using CSV import/export
- Smart Suggestions - Get intelligent HSN code suggestions based on product titles and descriptions
- Database Management - Comprehensive HSN code database with descriptions and GST rates
- Import/Export - CSV-based bulk import and export functionality
- Data Validation - Built-in validation and format checking
- Performance Optimized - Caching and optimized queries for better performance
- Frontend Display - Show HSN codes on product pages, cart, and order details
- Customizable Display - Style HSN code display to match your theme
- Multiple Positions - Choose where to display HSN codes on your store
- Custom GST Rates - Product-specific GST rate overrides when needed
- Dashboard Overview - Quick statistics and completion rates
- HSN Analytics - Product-wise HSN code assignment tracking
- Export Capabilities - Generate reports for accounting software
- GST Breakdown - Detailed GST rate analysis
- Upload the plugin files to
/wp-content/plugins/woohsn/directory, or install through WordPress admin - Activate the plugin through the 'Plugins' screen in WordPress
- Go to WooHSN > Settings to configure display options
- Start adding HSN codes to your products!
- Navigate to WooHSN > Settings
- Configure display options and styling preferences
- Choose where to show HSN codes (product pages, cart, orders)
- Set up GST rate display preferences
- Edit any WooCommerce product
- Find the "HSN Code Information" meta box
- Enter HSN code or use the smart suggestion feature
- Optionally enable custom GST rates for specific products
woohsn/
βββ woohsn.php # Main plugin file
βββ readme.txt # WordPress.org readme
βββ includes/ # Core functionality
β βββ class-woohsn-admin.php
β βββ class-woohsn-frontend.php
β βββ class-woohsn-product.php
β βββ class-woohsn-import-export.php
β βββ class-woohsn-tax-calculator.php
β βββ class-woohsn-database.php
β βββ functions.php
βββ assets/ # Static assets
β βββ css/
β β βββ admin.css
β β βββ frontend.css
β βββ js/
β βββ images/
βββ templates/ # Admin templates
β βββ admin-dashboard.php
βββ languages/ # Translation files
- WordPress: 5.0 or higher
- WooCommerce: 5.0 or higher
- PHP: 7.4 or higher
- MySQL: 5.6 or higher
[woohsn_code product_id="123" format="HSN: {code}" show_gst="yes"]$hsn_code = woohsn_get_product_hsn_code($product_id);
$gst_rate = woohsn_get_gst_rate($hsn_code);$tax_data = woohsn_calculate_product_gst($product_id, $price, $quantity);The plugin provides complete CSS control:
.woohsn-display {
background: #f8f9fa;
border: 1px solid #dee2e6;
padding: 8px 12px;
border-radius: 4px;
}Configure display format in settings:
HSN Code: {code}HSN: {code} (GST: {rate}%)Product Code: {code}
woohsn_before_display- Before HSN code displaywoohsn_after_display- After HSN code displaywoohsn_import_complete- After successful import
woohsn_display_format- Modify display formatwoohsn_gst_rate- Override GST rate calculationwoohsn_hsn_suggestions- Customize HSN suggestions
CREATE TABLE wp_woohsn_codes (
id mediumint(9) NOT NULL AUTO_INCREMENT,
hsn_code varchar(20) NOT NULL,
description text,
gst_rate decimal(5,2) DEFAULT NULL,
created_at datetime DEFAULT CURRENT_TIMESTAMP,
updated_at datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id),
UNIQUE KEY hsn_code (hsn_code)
);CREATE TABLE wp_woohsn_logs (
id mediumint(9) NOT NULL AUTO_INCREMENT,
operation_type varchar(20) NOT NULL,
file_name varchar(255),
records_processed int DEFAULT 0,
success_count int DEFAULT 0,
error_count int DEFAULT 0,
user_id bigint(20) UNSIGNED,
created_at datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);- Nonce Verification - All AJAX requests protected
- Capability Checks - Proper user permission validation
- Data Sanitization - Input sanitization and validation
- SQL Injection Protection - Prepared statements throughout
- File Upload Security - Secure file handling and validation
- Intelligent Caching - Transient-based caching system
- Database Optimization - Optimized queries and indexing
- Lazy Loading - On-demand resource loading
- Minified Assets - Compressed CSS and JavaScript
- CDN Ready - Compatible with content delivery networks
WooHSN automatically handles data migration when upgrading:
- Data Preservation - All existing HSN codes are preserved
- Setting Migration - Previous settings automatically migrated
- Meta Key Update - Product meta keys updated to new format
- Clean Migration - No data loss during updates
HSN codes not displaying:
- Check display settings in WooHSN > Settings
- Verify HSN codes are assigned to products
- Clear cache if using caching plugins
Import failing:
- Ensure CSV format matches template
- Check file permissions and size limits
- Verify proper column headers
Performance issues:
- Clear plugin cache and optimize database
- Check for theme/plugin conflicts
- Ensure WooCommerce is up to date
- β Initial WordPress.org release
- β HSN code assignment for products
- β Bulk import/export functionality
- β Smart HSN code suggestions
- β GST rate management
- β Frontend display options
- β Comprehensive admin dashboard
- β Reports and analytics
- β WordPress.org compliance
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the GPL v2 or later - see the LICENSE file for details.
- Documentation: Available in plugin dashboard
- Support Forum: WordPress.org Support
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Discussions
- Author & Developer: Chetan Upare
- HSN Database: Government of India Classification
- Icons: WordPress Dashicons
- Testing: WordPress & WooCommerce Community
Made with β€οΈ for Indian businesses using WordPress & WooCommerce