Skip to content

Commit

Permalink
only show pcp section on receipt if there is a pcp
Browse files Browse the repository at this point in the history
  • Loading branch information
demeritcowboy committed Aug 2, 2024
1 parent 9978e44 commit 51e4d25
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -2715,20 +2715,21 @@ public function _assignMessageVariablesToTemplate(&$values, $input, $returnMessa
$softDAO = new CRM_Contribute_DAO_ContributionSoft();
$softDAO->contribution_id = $this->id;
if ($softDAO->find(TRUE)) {
$pcpParams['pcpBlock'] = TRUE;
$pcpParams['pcp_display_in_roll'] = $softDAO->pcp_display_in_roll;
$pcpParams['pcp_roll_nickname'] = $softDAO->pcp_roll_nickname;
$pcpParams['pcp_personal_note'] = $softDAO->pcp_personal_note;

//assign the pcp page title for email subject
$pcpDAO = new CRM_PCP_DAO_PCP();
$pcpDAO->id = $softDAO->pcp_id;
if ($pcpDAO->find(TRUE)) {
$pcpParams['title'] = $pcpDAO->title;

// do not display PCP block in receipt if not enabled for the PCP poge
if (empty($pcpDAO->is_honor_roll)) {
$pcpParams['pcpBlock'] = FALSE;
if ($softDAO->pcp_id) {
$pcpDAO = new CRM_PCP_DAO_PCP();
$pcpDAO->id = $softDAO->pcp_id;
if ($pcpDAO->find(TRUE)) {
$pcpParams['title'] = $pcpDAO->title;

// Only display PCP block in receipt if enabled for the PCP page
if (!empty($pcpDAO->is_honor_roll)) {
$pcpParams['pcpBlock'] = TRUE;
}
}
}
}
Expand Down

0 comments on commit 51e4d25

Please sign in to comment.