From ced76c0477c0fc3fdd87a1dabc41bc627b33d9b2 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 27 Oct 2023 16:57:27 +1300 Subject: [PATCH] Suppress pay now on user dashboard if none configured --- CRM/Contribute/Page/UserDashboard.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Page/UserDashboard.php b/CRM/Contribute/Page/UserDashboard.php index 96b94a18d7..cdb2745468 100644 --- a/CRM/Contribute/Page/UserDashboard.php +++ b/CRM/Contribute/Page/UserDashboard.php @@ -32,7 +32,9 @@ class CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBo // which the tpl can iterate through - this should allow us to cope with competing attempts to add new buttons // and allow extensions to assign new ones through the pageRun hook // We could check for balance_amount > 0 here? It feels more correct but this seems to be working. - if (in_array($row['contribution_status_id:name'], ['Pending', 'Partially paid'], TRUE)) { + if (in_array($row['contribution_status_id:name'], ['Pending', 'Partially paid'], TRUE) + && Civi::settings()->get('default_invoice_page') + ) { $row['buttons']['pay'] = [ 'class' => 'button', 'label' => ts('Pay Now'), -- 2.25.1