pmpro-affiliates icon indicating copy to clipboard operation
pmpro-affiliates copied to clipboard

Adds a filter to determine commission on subtotal or total

Open JarrydLong opened this issue 1 year ago • 0 comments

All Submissions:

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:

  1. Enable the filter add_filter( 'pmpro_affiliates_calculate_on_subtotal', '__return_true' );
  2. 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
  3. 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?

JarrydLong avatar Jan 24 '24 06:01 JarrydLong