Automatic is systematically buying up every plugin for WooCommerce and making it a paid plugin that you have to add and manage through a WordPress.com account. I can’t even express my dislike for WooCommerce enough.
Anyways, don’t buy an $80 plugin from them just to add a service fee to products on checkout. Here’s how to cover those services on checkout. Currently this is set to “3.5%” and the line item is set to “Service Fee”.
function custom_woocommerce_cart_calculate_fees( $cart ) {
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
return;
}
$service_fee_percentage = 3.5; // Set the service fee percentage
$cart_subtotal = $cart->get_subtotal();
$service_fee = ( $cart_subtotal * $service_fee_percentage ) / 100;
$cart->add_fee( __( 'Service Fee', 'woocommerce' ), $service_fee, false ); // Set the line item name
}
add_action( 'woocommerce_cart_calculate_fees', 'custom_woocommerce_cart_calculate_fees' );