# Flat Handling Fee on Shipped Orders

> Adds a fixed packing and handling charge to every order that needs shipping, while downloads and services stay fee-free.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, fees, shipping, handling
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-handling-fee-shipped-orders/

## Code

```php
$wpide_handling = array(
    'amount'  => 1.95,                 // Fee amount.
    'label'   => 'Packing & handling', // Line label.
    'taxable' => true,
);

add_action( 'woocommerce_cart_calculate_fees', function ( $cart ) use ( $wpide_handling ) {
    if ( ( is_admin() && ! wp_doing_ajax() ) || ! $cart->needs_shipping() ) {
        return;
    }

    $cart->add_fee( $wpide_handling['label'], $wpide_handling['amount'], $wpide_handling['taxable'] );
} );
```

## Notes

Set $wpide_handling['taxable'] to match how your accountant treats handling charges.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Flat Handling Fee on Shipped Orders" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
