0

I have a complex combo i cant' solve using standard woocomerce taxes.

Here an example:

  1. Product: 20€
  2. Add a 4%: 0.80€
  3. Add a 22%: 4.58€
  4. Total to pay: 25.38

This can be accomplished by standard woocomerce taxes. In one case for customer with a specific fiscal rates, to total before taxes should be subctracted the 20% called 'ritenuta di acconto' but this do no changes other taxes. In this case we have:

  1. Product: 20€
  2. Add a 4%: 0.80€
  3. Add a 22%: 4.58€
  4. Subctract Ritenuta di Acconto: -4.00
  5. Total to pay: 21.38

Any help or suggestion it's days i'm getting mad on this, the first problem in years i couldn't solve using one of the many hooks woocomerce give us.

Thanks

I tried to change this visually and using woocommerce_calculated_total filters, at video i get the desired calculation and amount, the totals array is correct but when i push paypal payment it always make a payment of 25.38 even if total is forced to 21.38 like it recalculate all no using the filter anymore. I'm using the WooCommerce PayPal Payments plugin to have some extra option available (like the pay later option)

SteveAgl
  • 1
  • 1
  • 3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Mar 20 '23 at 13:52
  • Take a look at the action 'woocommerce_cart_calculate_fees'. This will allow you to add additional fees. Negative values -5.00 will subtract, positive values will add. You'll need to declare global on the ```$woocommerce``` variable and can add additional fees like this: ```$woocommerce->cart->add_fee( 'Shipping Fee', $shippingFee, true, 'standard' );``` – user2355051 Mar 20 '23 at 19:31
  • Thanks for the answer, i tried fees but they apply BEFORE tax calculation this 20% reduction must be applied to subtotal + taxes, before calculating the total amount to pay – SteveAgl Mar 21 '23 at 08:06

0 Answers0