Skip to content

Instantly share code, notes, and snippets.

@eighty20results
Created January 22, 2016 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eighty20results/09e941828cb44a036788 to your computer and use it in GitHub Desktop.
Save eighty20results/09e941828cb44a036788 to your computer and use it in GitHub Desktop.
VAT tax filter
<?php
/*
Plugin Name: PMPro VAT for Austria
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: PMPro: VAT for Austria
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
/*
Tax solution for Austria
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. this is enabled if the danish checkbox is checked.
function customtax_pmpro_tax($tax, $values, $order)
{
$rate_in_percent = 20; // Set to the required VAT/Tax rate
$tax_rate = (float)($rate_in_percent/100);
$tax = round((float)$values['price'] * $tax_rate, 2);
return $tax;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment