Answers.Body: <p>I would probably do:</p>
  
  <pre><code>foreach ($feeBlock as $feeBlockId =&gt; $fee) {
     .....
     $feeBlock[$feeBlockId]['help_post'] = "blahblah"
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-06T07:19:26.070Z
Answers.LastActivityDate: 2019-05-06T07:19:26.070Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>Just as a thought i think you may need to set $amount = $feeBlock right at the end as your modifying $amount</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-16T01:15:14.410Z
Answers.Text: 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!
Answers.UserDisplayName: jboeke
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-15T23:54:45.073Z
Answers.LastActivityDate: 2016-12-15T23:54:45.073Z
Answers.UserDisplayName: Seamus Lee
Body: <p>There are several fields I expect to be able to change in the buildAmount hook that just won't change for me. One example:</p>
  
  <pre>
  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
  
        }
  }
  </pre>
  
  <p>The help_post text remains as originally set in the price set. Why?</p>
  
Tags: <hooks><price-sets>
Title: Can't change help_post text in Price Set using the civicrm_buildAmount hook
ThreadText: # Can't change help_post text in Price Set using the civicrm_buildAmount hook
  
  (Asked by: username_0 on 2016-12-15)
  
  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?
  
  **Tags:** hooks, price-sets
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-05-06. Score: 0
  
  I would probably do:
  foreach ($feeBlock as $feeBlockId => $fee) {
     .....
     $feeBlock[$feeBlockId]['help_post'] = "blahblah"
  }
  
  
  ---
  
  ### Answer by username_2 on 2016-12-15. Score: 0
  
  Just as a thought i think you may need to set $amount = $feeBlock right at the end as your modifying $amount
  
  > **Comments:**
  > **username_0**: 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!  
  
  ---
  
  