[WooCommerce 1.6.5] Add a fixed fee to the cart total (7 posts)

  1. Stefano
    Posted 3 years ago #

    Hello, how can I add a fixed fee (like a fixed tax of $2) always at the end of my shopping cart in WooCommerce 1.6.5, showing it like a tax?

    What I want to have is that in all my pages and email (cart, checkout, various emails, etc) somethig like this:

    Order Subtotal: $100
    Fee: $2
    Order Total: $102

    Is it possible? I can't fint a way to set up a fixed fee tax... I can only have % taxes...

    Thanks a lot in advance!

  2. boldt
    Posted 3 years ago #


    (where my-woocommerce.com is your WP web-address)

    here you can establish a fixed fee

  3. Stefano
    Posted 3 years ago #

    Thanks a lot boldt,
    but unfortunately this is a "shipping cost".
    All my products are marked as "virtual", so no shipping is involved and no shipping costs are added to the order.

    Any other idea? I think I have to edit the plugin code to achieve what I want... but I don't really know where to look and what to do... I have a little more than basic PHP knowledge

  4. boldt
    Posted 3 years ago #

    ok now I know that.

    Do not edit the woocommerce-code! it will become a nightmare with all those updates we see of woocommerce.

    I think it is better to design an additional plugin, although I do not know how. The main problem is that Woocommerce do not seems logical in its construction.

    A manual for woocommerce plugin developers would be appreciated.

  5. Stefano
    Posted 3 years ago #

    "A manual for woocommerce plugin developers would be appreciated."

    Agreed! ;) The official documentation is not really helpful...

  6. boldt
    Posted 3 years ago #

    Maybe it is possible to cancel a woocommerce function inside the template functions. like this

    remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30);
    remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30);

    which removes product reviews?

  7. Safeer
    Posted 2 years ago #

    You can use the "woocommerce_before_calculate_totals" hook and add additional fee to cart like this.

    $woocommerce->cart->add_fee( 'Additional Fee', $addfee, $taxable = false, $tax_class = '' );

    Checkout here for more details

Topic Closed

This topic has been closed to new replies.

About this Topic