Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created November 28, 2024 07:18
Show Gist options
  • Save andrewlimaza/27384f6fd00ef7171cf149622881692c to your computer and use it in GitHub Desktop.
Save andrewlimaza/27384f6fd00ef7171cf149622881692c to your computer and use it in GitHub Desktop.
Flat rate 15% VAT/TAX added to all PMPro orders and checkouts
<?php
/**
* Add 15% tax to all PMPro checkouts.
* Add this code to your site by visiting this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function customtax_pmpro_tax( $tax, $values, $order ) {
$tax = round((float)$values['price'] * 0.15, 2);
return $tax;
}
add_filter("pmpro_tax", "customtax_pmpro_tax", 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment