Skip to content

Instantly share code, notes, and snippets.

@mlutfy
Created October 7, 2017 20:14
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 mlutfy/e9cdf347aa5e6194767f2b64df9e1dd5 to your computer and use it in GitHub Desktop.
Save mlutfy/e9cdf347aa5e6194767f2b64df9e1dd5 to your computer and use it in GitHub Desktop.
/**
* Implements hook_civicrm_alterPriceSet().
*/
function cdntaxcalculator_civicrm_alterPriceSet($formName, &$form, &$priceset) {
if ($formName == 'CRM_Member_Form_Membership') {
$contact_id = $form->_contactID;
$taxes = CRM_Cdntaxcalculator_BAO_CDNTaxes::getTaxesForContact($contact_id);
CRM_Cdntaxcalculator_BAO_CDNTaxes::applyTaxesToPriceset($priceset['fields'], $taxes);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment