WordPress.org

Support

Support » Plugins and Hacks » [WooCommerce 1.6.5] Add a fixed fee to the cart total

[WooCommerce 1.6.5] Add a fixed fee to the cart total

  • 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!
    Stefano

Viewing 6 replies - 1 through 6 (of 6 total)
  • Goto:
    http://my-woocommerce.com/wp-admin/admin.php?page=woocommerce_settings&tab=shipping&section=WC_Flat_Rate

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

    here you can establish a fixed fee

    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

    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.

    “A manual for woocommerce plugin developers would be appreciated.”

    Agreed! 😉 The official documentation is not really helpful…

    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?

    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
    http://www.thecodepoetry.com/update-woocommerce-cart-price-with-code

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[WooCommerce 1.6.5] Add a fixed fee to the cart total’ is closed to new replies.
Skip to toolbar