diff --git a/CRM/Contribute/Page/ContributionRecur.php b/CRM/Contribute/Page/ContributionRecur.php index 977ec388a29a..ad021d1dc70a 100644 --- a/CRM/Contribute/Page/ContributionRecur.php +++ b/CRM/Contribute/Page/ContributionRecur.php @@ -67,6 +67,16 @@ public function view() { } } + // Add linked membership + $membership = civicrm_api3('Membership', 'get', array( + 'contribution_recur_id' => $recur->id, + )); + if (!empty($membership['count'])) { + $membershipDetails = reset($membership['values']); + $values['membership_id'] = $membershipDetails['id']; + $values['membership_name'] = $membershipDetails['membership_name']; + } + $this->assign('recur', $values); } } diff --git a/templates/CRM/Contribute/Page/ContributionRecur.tpl b/templates/CRM/Contribute/Page/ContributionRecur.tpl index e13232be7b91..6ab8e225947e 100644 --- a/templates/CRM/Contribute/Page/ContributionRecur.tpl +++ b/templates/CRM/Contribute/Page/ContributionRecur.tpl @@ -51,6 +51,11 @@ {if $recur.payment_processor}