WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Stefano
    Member
    Posted 1 year 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!
    Stefano

  2. boldt
    Member
    Posted 1 year ago #

    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

  3. Stefano
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

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

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

  6. boldt
    Member
    Posted 1 year 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
    Member
    Posted 7 months 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
    http://www.thecodepoetry.com/update-woocommerce-cart-price-with-code

Topic Closed

This topic has been closed to new replies.

About this Topic