pmpro-affiliates
pmpro-affiliates copied to clipboard
Adds a filter to determine commission on subtotal or total
All Submissions:
- [x] Have you followed the Contributing guidelines?
- [x] Does your code follow the WordPress' coding standards?
- [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
Changes proposed in this Pull Request:
Adds a filter to queries to determine if we should base commission off of the order subtotal (before tax) or total (after tax).
New filter is called pmpro_affiliates_calculate_on_subtotal and accepts a boolean value
How to test the changes in this Pull Request:
- Enable the filter
add_filter( 'pmpro_affiliates_calculate_on_subtotal', '__return_true' ); - Run a test checkout with tax in place or edit an order that has earned an affiliate commission - your subtotal and total should be different
- Commission will be based on the subtotal when enabled
Other information:
- [x] Have you added an explanation of what your changes do and why you'd like us to include them?
- [x] Have you successfully run tests with your changes locally?