From: Eileen McNaughton Date: Mon, 8 May 2023 04:27:08 +0000 (+1200) Subject: Re-instate the renewal message X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bc793a1b51cfc60b8231622c001ba6758109829a;p=civicrm-core.git Re-instate the renewal message --- diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 8ea9c95123..1b79b33b3d 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -446,6 +446,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { $this->set('values', $this->_values); $this->set('fields', $this->_fields); } + $this->assign('isShowMembershipQuickConfigBlock', $this->isShowMembershipQuickConfigBlock()); $this->set('membershipBlock', $this->getMembershipBlock()); // Handle PCP @@ -1317,6 +1318,16 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { return (bool) $this->_useForMember; } + /** + * Should the membership block be displayed. + * + * This should be shown when the price set is quick config and is a membership price set. + * @return bool + */ + protected function isShowMembershipQuickConfigBlock(): bool { + return CRM_Core_Component::isEnabled('CiviMember') && $this->getMembershipBlock() && $this->isQuickConfig(); + } + /** * Is the contribution page configured for 2 payments, one being membership & one not. * diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index a7ee32e09e..3a0c541a7e 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -76,7 +76,7 @@
{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}
{/if} - {if !empty($useForMember) && !$ccid} + {if $isShowMembershipQuickConfigBlock && !$ccid}
{include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="makeContribution"}
diff --git a/templates/CRM/Contribute/Form/Contribution/MembershipBlock.tpl b/templates/CRM/Contribute/Form/Contribution/MembershipBlock.tpl index 4ad6d4ad82..fd70bbe249 100644 --- a/templates/CRM/Contribute/Form/Contribution/MembershipBlock.tpl +++ b/templates/CRM/Contribute/Form/Contribution/MembershipBlock.tpl @@ -7,7 +7,7 @@ | and copyright information, see https://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{if !empty($useForMember) AND !$is_quick_config} +{if $isShowMembershipQuickConfigBlock}
{if $context EQ "makeContribution"}