The following is a quick but useful snippet that automatically adds custom charges to the WooCommerce cart. This code segment uses the default currency for each user role to apply a defined fixed cost to the shopping cart. Simply place this code in the functions.php file in your theme folder:

* WooCommerce Extra Feature
* --------------------------
* Add custom fee to cart automatically
function woo_add_cart_fee() {

global $woocommerce;

$woocommerce->cart->add_fee( __('Custom', 'woocommerce'), 5 );

add_action( 'woocommerce_cart_calculate_fees', 'woo_add_cart_fee' );