I am trying to setup conditional tax based on province for one membership in payment page. is there any reference I can use? is this hook needed and also custom code?

I am using drupal 7 with civi crm 4.7.1 version

some references would be great.

thank you

2 Answers 2


The easy - non-code - way to handle this is to create a Drupal node (page) with a select Province - and then based on Province selected popup a button with a link to a Contribution page that is configured with a Priceset that sells that Membership at that Province's General Sales Tax.

Edit: this is the only sustainable way to do this right now (see comment below).


One way of Doing this: First of all you need to create priceset for the membership and you need to create an Extension for handling this calculation and you can use hook_civicrm_buildAmount() and please put all you code in the extension

Please refer to the below link for hooks


  • I am trying to get province working with tax for membership, is there any extension for that, or this is a pretty hard hook for it?
    – Boby
    Commented Mar 28, 2016 at 7:09
  • I did look at this w/ Mathieu Lufty recently and yes it’s easy to add a buildAmount hook to override the default tax rate - however - you can’t edit (which includes emailing a receipt; adding a note) such Contributions as on Save sales tax gets recalculated on every single save. And you end up with a Tax refund in your financial items. Commented Oct 18, 2017 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.