Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tax solution for British Columbia, Canada to be used with Paid Memberships Pro
<?php
/*
Plugin Name: PMPro Custom Tax
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for PMPro
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
/*
Tax solution for a fixed tax rate calculation (13%)
Edit as needed, then save this file in your plugins folder and activate it through the plugins page in the WP dashboard.
*/
// Add tax info to cost text.
function customtax_pmpro_tax($tax, $values, $order)
{
$tax = round((float)$values[price] * 0.13, 2);
return $tax;
}
add_filter("pmpro_tax", "customtax_pmpro_tax", 10, 3);
// Add tax specific text to membership level description
function customtax_pmpro_level_cost_text($cost, $level)
{
//only applicable for levels > 1
$cost .= " Members will be charged a 13% tax.";
return $cost;
}
add_filter("pmpro_level_cost_text", "customtax_pmpro_level_cost_text", 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.