Comments 6Wolfgang started the conversationAugust 28, 2023 at 10:01am Hello! I have set up a dynamic rule with a discount of 5%. But in the calculation then only 4.2% discount comes out. Where could be the error?I found out that the discount is calculated from the amount without tax. How can I change this? Thanks and best wishes. 2,218WebWizards repliedAugust 29, 2023 at 5:25amHello Wolfgang,To have rules include tax in the calculation, please add this PHP code snippet to your site: add_filter('b2bking_cart_subtotal', function($value){ $value = WC()->cart->get_subtotal() + WC()->cart->get_subtotal_tax(); return $value; }, 10, 1); A PHP snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/Let me know if that solves it for you,Kind regards,Stefan 6Wolfgang repliedAugust 29, 2023 at 6:48amHello Stefan, yes, it works fine.Thank you!1 Like Sign in to reply ...
Hello!
I have set up a dynamic rule with a discount of 5%. But in the calculation then only 4.2% discount comes out. Where could be the error?
I found out that the discount is calculated from the amount without tax. How can I change this?
Thanks and best wishes.
Hello Wolfgang,
To have rules include tax in the calculation, please add this PHP code snippet to your site:
A PHP snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/
Let me know if that solves it for you,
Kind regards,
Stefan
Hello Stefan,
yes, it works fine.
Thank you!