Add a custom fee to cart without showing it in WooCommerce cart total
-
In WooCommerce I have added a custom fee to cart, with the following code:
function prefix_add_discount_line( $cart ) { $discount = $cart->subtotal * 0.15; $cart->add_fee( __( 'Pagamento Eolie') , $discount, true, 'Eolie Iva 22%' ); } add_action( 'woocommerce_cart_calculate_fees', 'prefix_add_discount_line' );
But I need to not add this fee to cart total.
In the cart page I have those totals lines (example):
Subtotale: €15.00
Tassa Carrello: €5.00
Pagamento Eolie: €2.48
Iva 10% (stimati per Italia): €1.50
Eolie Iva 22% (stimati per Italia): €0.54
Totale: €24.52The total must exclude (always) Pagamento Eolie and Eolie Iva 22% (stimati per Italia) and the total result is €21.5
Thx
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Add a custom fee to cart without showing it in WooCommerce cart total’ is closed to new replies.