• Resolved websitegirlCa

    (@websitegirlca)


    Hi Is there a way to add a service fee to the cart? Before Tax.

    Example: an event/product costs $75 we want to add a service fee of 20% of the 75$ ($15) then taxes would be added. I have been looking for options but do not see any… Any assistance would be greatly appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @websitegirlca

    Yes, you can add a service fee to the cart before tax by using a plugin or custom code. I’ll provide you with two options to achieve this:

    Option 1: Using a plugin
    One of the plugins that can help you achieve this is the “Extra Fees for WooCommerce” plugin. This plugin allows you to add various types of fees and discounts to your WooCommerce store, including percentage-based service fees. You can find more information about this plugin and how to set it up here: Extra Fees for WooCommerce.

    Option 2: Using custom code
    If you prefer using custom code, you can add the following code snippet to your theme’s functions.php file or a code snippet plugin. This code will apply a 20% service fee to the cart subtotal before tax calculation.

    function custom_woocommerce_cart_calculate_fees( $cart ) {
    if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
    return;
    }
    
    $service_fee_percentage = 20; // 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 );
    }
    add_action( 'woocommerce_cart_calculate_fees', 'custom_woocommerce_cart_calculate_fees' );

    Please note that modifying your theme’s files or using custom code may require some technical knowledge. If you’re not comfortable with this, I recommend reaching out to a developer or using the plugin option mentioned above.

    I hope this helps!

    Hi @websitegirlca ,

    Thanks for reaching out!

    I understand that you would like o add a 20% service fee to the cart (before tax), is this correct?

    As @shameemreza mentioned, the Extra Fees for WooCommerce extension can help you achieve this ??

    WooCommerce.com offers a?30-day refund policy?which you can take advantage of, allowing you to test the extension, and make sure that it is what you are looking for.

    Should you have any pre-sales related questions, kindly contact us directly at?WooCommerce.com → My Account → Support. You will need to create an account if you do not have one already.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding Service fee in Woocommerce.’ is closed to new replies.