Donation by User Role at Checkout Page in WooCommerce

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.

Download Folder

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.