4

There are several fields I expect to be able to change in the buildAmount hook that just won't change for me. One example:

function myext_civicrm_buildAmount($pageType, &$form, &$amount) {

      $feeBlock =& $amount;

      foreach ( $feeBlock as &$fee ) {

          if ( !is_array( $fee['options'] ) ) {
            continue;
          }

      // My debug-to-file function prints the original value as expected
      // fdebug($fee['help_post']);

      $fee['help_post'] = 'New help text';

      // My debug-to-file function prints the new value as expected
      // fdebug($fee['help_post']);

      // But the value in the price set, when rendered, does not change

      }
}

The help_post text remains as originally set in the price set. Why?

0

Just as a thought i think you may need to set $amount = $feeBlock right at the end as your modifying $amount

  • Good thought. But, I tried that and still no luck. I even skipped the $feeBlock variable and referenced $amount directly and my help_post values are still not changing. Thanks! – jboeke Dec 16 '16 at 1:15
0

I would probably do:

foreach ($feeBlock as $feeBlockId => $fee) {
   .....
   $feeBlock[$feeBlockId]['help_post'] = "blahblah"
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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