WooCommerce Customs Fees

Overview

↑ Back to top

WooCommerce Customs Fees allows your WooCommerce store to automatically calculate and display import duties, customs fees, and taxes for international orders during checkout.

We are not tax professionals; our advice only applies to how to use our software. We recommend consulting a tax professional or accountant to ensure the correct fees are applied.

Requirements

↑ Back to top
  • WooCommerce version 9.0 or higher
  • WordPress version 6.8 or higher
  • PHP version 7.4 or higher
  • MySQL version 5.6 or higher

Installation

↑ Back to top

The simplest way to start using a product from WooCommerce.com is to use the “Add to store” functionality on the order confirmation page or the My subscriptions section in your account.

  1. Navigate to My subscriptions.
  2. Find the Add to store button next to the product you’re planning to install.
  3. Follow the instructions on the screen, and the product will be automatically added to your store.

Alternative options and more information at:
Managing WooCommerce.com subscriptions.

Adding a WooCommerce.com subscription to your store

Setup and Configuration

↑ Back to top

Enable WooCommerce Tax: Go to WooCommerce > Settings > General and check Enable tax rates and calculations. Customs Fees will not work without tax calculations enabled.

After enabling tax calculations, go to WooCommerce > Settings > Tax > Customs Fees. This is where you can configure the extension and set up the fees.

In short

↑ Back to top

Set the default product origin country, this will apply to all new products unless you change it on the product. Then either manually add the fees, or use one of the presets. That’s it. Your fees will now be added. Make sure to verify this by testing it on the checkout page.

Note: Customs fees only apply to physical products. Digital/virtual products are automatically excluded from calculations.

Settings page from the Customs Fees for WooCommerce extension

Set the default product origin

↑ Back to top

All products need to have their country of origin added for the right fees to be calculated. If no origin country is specified on the product, the “default product origin” country will be used.

Choose between:

  • Same as store location (Recommended for single-location businesses)
    • Automatically uses your WooCommerce store address as the origin.
    • Perfect if you ship everything from one location.
    • Updates automatically if you change your store address.
  • No default (For multi-supplier stores)
    • No automatic default, requires manual origin for each product.
    • Best when products ship from various locations.
    • Prevents incorrect fee calculations from assumed origins.
  • Different country (For dropshipping or specific warehouses)
    • Select a specific country as your default origin.
    • Useful when your inventory is in a different country than your business.
    • Example: Store in UK, but warehouse in Germany.
Default product origin

Quick Start with Presets

↑ Back to top

Some known customs fees are already added to the extension. Select the ones that apply to your store and customer base.

Note: Fees are subject to change and you are responsible for making sure that the right fees apply.

Create fee rules

↑ Back to top

How do fees calculations work?

↑ Back to top

Customs Fees calculates fees per rule at the checkout. The extension reviews all rules that apply to products in the basket based on the destination, it looks at the priority and the calculation type. It then:

  • Groups all fees that come from the same rule (to bundle them under the same label at the checkout)
  • Shows the total fees at the checkout

Example:

  • 3x Blue T-shirt from China → USA (each gets 25% duty).
  • 2x Smartwatch from China → USA (each gets 25% duty).
  • Display at checkout:
    • China Import Duty (25%) x 3: $45.00
    • China Import Duty (25%) x 2: $50.00
    • Total Customs Fees: $95.00
customs fees cart block

Add rules

↑ Back to top
  • Go to: All Rules > Add New Rule
  • Choose a label name. This is what your customers will see at the checkout, so it’s best to be as clear as possible. For example, “Footwear from China”.
  • Add a priority. A higher number means a higher priority, which means that this rule is first considered before any other rules that also match with the product
  • Select the country of origin (where the product was made) and the destination country (where the product is shipped to).
  • Select the rule type:
    • All Products will add a fee that’s added to all products
    • By Category will only add a fee to products from that category –> add the category you want it to apply to
    • By HS Code will only add a fee to products with a matching code on the product. HS Codes are an internationally agreed classification system to identify product types. For example, Lithium batteries would get 8506,8507 added.
    • By Category + HS Code will only add a fee to products matching both the category and the HS code. This is for very specific matching.
  • Choose the calculation type: percentage or absolute.
  • Add the rate.
  • Choose the stacking mode:
    • Add (default) means that these fees will be added with all other matching rules. For example: 10% + 5% = 25%.
    • Override means that a rule with a higher priority will replace a lower priority. This is best used for exceptions to general rules.
    • Exclusive means that the first matching rule (highest priority) will apply without any other rules further being considered.

Some examples on fee calculation based on priority and stacking mode

↑ Back to top

Example 1: Add Mode

Customs fees: stack mode

Calculation Process:

  • Step 1: Find all matching rules
    • China Apparel Tariff (HS 61* matches) – 69%
    • Section 301 Surcharge (HS 61* matches) – 15%
    • General Import Duty (All Products) – 7%
  • Step 2: Each matching rule creates its own fee line item (Add mode)
    • China Apparel: $918.89 × 69% = $634.03
    • Section 301 Surcharge: $918.89 × 15% = $137.83
    • China General Import: $918.89 × 7% = $64.32
  • Step 3: All fees are added to create total customs charges
    • Total Customs & Import Fees = $918.89 + $137.83 (15%) + $64.32 (7%) + $634.03 (69%) + $100 = $1,855.08
Add Mode Examples

Example 2: Override Mode

OVERRIDE Mode

Calculation Process:

  • Step 1: Find all matching rules
    • China T-Shirt Special (HS 6109* matches) – Priority 1
    • China Apparel (HS 61* matches) – Priority 10
    • China General Import (All Products) – Priority 30
  • Step 2: Apply ONLY the highest priority rule (lowest number)
    • Winner: China T-Shirt Special (Priority 1) – 35%
    • Ignores: 69% apparel rate and 7% general rate
  • Step 3: Calculate fee
    • Total Customs & Import Fees = $918.89 + $321.61 (35%) + $100 = $1,340.50
Example 2: OVERRIDE Mode

Note: Override mode is useful for special exemptions or negotiated rates.

Example 3: Exclusive Mode

exclusive mode

Calculation Process:

  • Step 1: Find all matching rules
    • China Apparel (HS 61,62 matches 6109) – Specific pattern
    • China General Import (All Products) – General fallback
  • Step 2: Sort rules by priority and specificity
    • Sorts by HIGHER priority numbers first (30 > 5)
    • If priorities were equal, specificity would be the tiebreaker.
    • Sorted order: [China Apparel (30), China General Import (5)]
  • Step 3: Apply FIRST rule from sorted list
    • Winner: China Apparel (69%) – First in sorted list.
    • Exclusive mode returns immediately with first rule.
  • Step 4: Calculate fee
    • Total Customs & Import Fees = $918.89 + $634.03 (69%) + $100 = $1,652.92

Add product-specific information

↑ Back to top

In most cases, a default origin country, combined with rules that apply on all products or on product categories will be sufficient to configure the rules. However, in some cases, you will want to add information on a product level so more exclusive rules can be applied.

Edit a single product

↑ Back to top

Via the product edit screen

  • Go to Products > All Products, and edit the product
  • Go to Product data > Inventory.
  • There you can add the following information:
    • HS/Tariff Code. Enter the 6 to 10 digit Harmonized System code.
    • Country of Origin. Override the default country of origin you’ve added in the Customs Fees settings. This product-specific country will always get the priority.
  • Select Update.
Customs Fees Product settings

Via Quick Edit

  1. Go to Products > All Products.
  2. Hover over a product and click Quick Edit.
  3. Update the HS Code and/or Country of Origin.
  4. Select Update.

Bulk update products

↑ Back to top

Via All Products

  1. Go to Products > All Products.
  2. Select multiple products with the checkboxes.
  3. Choose Edit from Bulk Actions dropdown.
  4. Add a HS Code and/or Country of Origin for all selected.
  5. Click Update.
Customs fees quick edit

Via CSV export/import

↑ Back to top
  • Export your products using these instructions.
  • When Customs Fees is enabled, two columns will be added: HS Code and Country of Origin. You can edit them there per product. Note: Country uses a two-letter country code.
  • Save your changes as CSV (UTF-8 encoding recommended).
  • Import the updated products using the instructions linked to above.

A little more on HS codes

↑ Back to top

Harmonized System Codes (or: HS Codes) are a way for countries to talk about exporting and importing goods in an organized — or harmonized — way. Basically, an HS code should tell the customs official instantly what type of product is in the shipment. This means that identifying what duties should apply, what measures should be taken, whether the product can legally be imported, etc. is made easy. Adding HS Codes to your international shipping will likely improve the import process resulting in a faster delivery and a more accurate customs charge.

HS Codes best practices

↑ Back to top
  • Use six-digit codes minimum (8507.60).
  • More digits mean more precise classification.
  • Refer to your country’s customs tariff schedule.
  • Common HS codes:
    • 6109: T-shirts and singlets.
    • 8517: Smartphones.
    • 9503: Toys.
    • 8471: Computers.

Where to find HS codes?

↑ Back to top

Developer reference

↑ Back to top

Override calculations for specific conditions:

add_filter( 'cfwc_calculated_fee', function( $fee, $product, $rule ) {
    // Apply 50% discount for orders over USD $1000
    if ( WC()->cart->subtotal > 1000 ) {
        $fee = $fee * 0.5;
    }
    return $fee;
}, 10, 3 );

Filters

↑ Back to top
// Modify calculated fee amount
apply_filters( 'cfwc_calculated_fee', $fee, $product, $rule );

// Filter matching rules
apply_filters( 'cfwc_matching_rules', $rules, $product );

// Customize fee label
apply_filters( 'cfwc_fee_label', $label, $rule );

// Modify product origin
apply_filters( 'cfwc_product_origin', $origin, $product_id );

Actions

↑ Back to top
// After fee calculation
do_action( 'cfwc_after_calculate_fees', $fees, $cart );

// After saving rule
do_action( 'cfwc_rule_saved', $rule_id, $rule_data );

// After importing rules
do_action( 'cfwc_rules_imported', $imported_count );

Troubleshooting

↑ Back to top

Most of the errors you will see in calculations will be connected to the configuration. Testing the rules and figuring out which — potentially conflicting — rules are adding to the wrong calculation will be the first thing to do.

The extension logs can help you with detailed information on that. When WP_DEBUG is enabled, the extension logs detailed information:

  1. Edit wp-config.php
  2. Add these lines.
  3. Check logs at /wp-content/debug.log
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Note: Unlike some WooCommerce extensions, Customs Fees logs do not appear in WooCommerce > Status > Logs. This extension uses WordPress debug logging for development diagnostics rather than WooCommerce’s logger system. To view logs, you need to access the debug.log file directly via FTP or your hosting file manager.

What gets logged:

  • Any errors or configuration issues.
  • Which rules matched each product.
  • Fee calculation details with amounts.
  • Priority and stacking decisions.
  • Origin country lookups.

Common issues and solutions

↑ Back to top

Do customers pay these fees at checkout?

↑ Back to top

Yes, customers pay these fees as part of their order total. When customs fees are calculated, they’re added to the WooCommerce cart and become part of the total payment collected at checkout. These are NOT informational-only fees.

This also means that customers will expect you to pay for these fees upfront so the shipment does not get stuck at the border.

Can I have different fees for different states or regions?

↑ Back to top

Currently, the extension only supports country-level rules. While you could theoretically use the cfwc_calculated_fee filter to check customer state via WC()->customer->get_billing_state(), this isn’t built-in functionality. State/region-specific fees would require custom development.

How accurate are the fee calculations?

↑ Back to top

They are very accurate, but only based on your rules. Keep rules updated with current customs regulations and use precise HS codes.

Can products have multiple HS codes?

↑ Back to top

No. Each product can have one HS code. For products fitting multiple categories, choose the most specific applicable code.

What happens if no rules match a product?

↑ Back to top

No customs fees are added. Products without matching rules are assumed to have no customs requirements. Create general import rules (match type: “All Products”) as fallbacks if needed.

Can I exclude certain products from all fees?

↑ Back to top

Yes, create a rule with:

  • Priority: 1 (highest)
  • Stack Mode: Exclusive
  • Fee Amount: 0
  • Target specific products via category or HS code.

Is it compatible with other tax plugins?

↑ Back to top

Yes. Customs fees are added as WooCommerce fees (not taxes) and calculate independently from tax plugins.

Does it work with multicurrency plugins?

↑ Back to top

The extension uses WooCommerce’s base currency for calculations. Compatibility depends on whether your multicurrency plugin properly converts WooCommerce fees.

Can I customize the fee display format?

↑ Back to top

Yes, use the cfwc_fee_label filter. Here’s the code example for the developer reference:

// Customize fee label format
add_filter( 'cfwc_fee_label', function( $label, $rule ) {
    // Add custom prefix to all customs fees
    return '🌍 ' . $label . ' (Customs)';
}, 10, 2 );

// Or modify based on rule type
add_filter( 'cfwc_fee_label', function( $label, $rule ) {
    if ( isset( $rule['type'] ) && $rule['type'] === 'percentage' ) {
        return $label . ' (Import Duty)';
    }
    return $label . ' (Processing Fee)';
}, 10, 2 );

Why do some products show duplicate fees?

↑ Back to top

Check for overlapping rules with “Add” stacking mode. Consider using “Override” or “Exclusive” mode.

Fees disappeared after updating WooCommerce?

↑ Back to top
  • Clear all caches (browser, plugin, server).
  • Verify the plugin is still active.
  • Check that tax calculations are still enabled.
  • Confirm your rules are still present and active.

How do I completely remove all fees temporarily?

↑ Back to top

You can either deactivate the extension or delete all rules in the settings.

Note: This only affects new orders. Existing orders retain their recorded fees.

Why do some products show grouped fees (e.g., “x 3”)?

When multiple products match the same rule, fees are grouped for clarity. For example, three shirts with the same 25% duty show as “Import Duty (25%) x 3” instead of three separate lines.

Questions and Support

↑ Back to top

Something missing from this documentation? Do you still have questions and need assistance?

  • Have a question about a specific extension or theme you’d like to purchase? Use our Contact us page to get answers.
  • Have you already purchased this product and need some assistance? Get in touch with a Happiness Engineer via the WooCommerce.com Support page and select this product name in the “Product” dropdown.

Related Products

Offer add-ons like gift wrapping, special messages or other special options for your products.

Add shipment tracking information to your orders.