The PHP code in this downloadable product folder enables you to add a donation percentage to your WooCommerce checkout page totals table based on a specific user role.
Restricts the donation for employees with a specific user role only on the checkout page totals table.
The donation percentage is calculated based on the subtotal before shipping charges and taxes are added if applicable.
Video Demo
Code Installation
Copy and paste the PHP code to the end of your child themes functions file or custom functionality/code snippets plugin.
Set User Role
Swap out the user role in the code on line 24 from administrator to any other default or custom user role.
Was This Tutorial Helpful?