In Woocommerce checkout page, I'am trying to add a check box on checkout page and call it "Installment".
When checkbox is ticked to add 3 percent total amount.
For example, if the total amount is 100$
it will add an extra section before the total amount and call it Installment fee (3%
= $3
) and add that amount to the total.
Based on "Dynamic shipping fee based on custom radio buttons in Woocommerce", Here it's a light changed version, with a checkbox located after billing fields, that will enable a 3% fee when checkbox is checked:
Code goes in function.php file of your active child theme (or active theme). Tested and works.
The field displayed after billing checkout fields:
The Percentage "Installment" fee activated only when checkbox is checked: