CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • hook_civicrm_buildAmount and membership fees
Pages: [1]

Author Topic: hook_civicrm_buildAmount and membership fees  (Read 2029 times)

OwenRogers

  • I’m new here
  • *
  • Posts: 4
  • Karma: 1
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.62-log
  • PHP version: 5.2.13
hook_civicrm_buildAmount and membership fees
March 17, 2009, 09:34:21 am
hook_civicrm_buildAmount( $pageType, &$form, &$amount )

The API document says: "This hook is called when building the amount structure for a Contribution or Event Page. It allows you to modify the set of radio buttons representing amounts for contribution levels, membership fees and event registration fees."

I don't see how it can be used to influence membership fees as they aren't part of the $amount array. They *are* part of $membershipTypes. Am I wrong?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: hook_civicrm_buildAmount and membership fees
March 17, 2009, 10:01:53 am

You are right. the hook does not allow you to modify membership fees and i've fixed the docs

A membership fee hook is probably useful, please file an issue and we'll potentially add it to 2.2.x

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

OwenRogers

  • I’m new here
  • *
  • Posts: 4
  • Karma: 1
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6.20
  • MySQL version: 5.0.62-log
  • PHP version: 5.2.13
Re: hook_civicrm_buildAmount and membership fees
March 20, 2009, 06:02:58 am
Thanks, Donald.

On a related note, if it helps anyone, the correct way to retrieve an eventID for use with buildAmount is via:

$form->_values['event']['id']

$form->_id only works for contribution pages...

awasson

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 7
  • Living in a world of Drupal / CiviCRM
    • My Company: Luna Design
  • CiviCRM version: Latest
  • CMS version: Drupal 6/7/8
  • MySQL version: 5.x
  • PHP version: 5.3.x
Re: hook_civicrm_buildAmount and membership fees
July 19, 2010, 03:47:47 pm
I know this is an old thread but for the sake of continuity, I am posting here. Let me know if it would be better to start a new thread.

This explains why I can't influence (add tax to) membership fees but does this mean that there isn't a hook that will affect membership fee contributions?

I'm trying to create a Drupal module that will add a tax field.

Thanks,
Andrew 
My CiviCRM Extension Workshop: https://github.com/awasson

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • hook_civicrm_buildAmount and membership fees

This forum was archived on 2017-11-26.