$this->set('values', $this->_values);
$this->set('fields', $this->_fields);
}
+ $this->assign('isShowMembershipQuickConfigBlock', $this->isShowMembershipQuickConfigBlock());
$this->set('membershipBlock', $this->getMembershipBlock());
// Handle PCP
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.
*
<div class="help">{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}</div>
{/if}
- {if !empty($useForMember) && !$ccid}
+ {if $isShowMembershipQuickConfigBlock && !$ccid}
<div class="crm-public-form-item crm-section">
{include file="CRM/Contribute/Form/Contribution/MembershipBlock.tpl" context="makeContribution"}
</div>
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
-{if !empty($useForMember) AND !$is_quick_config}
+{if $isShowMembershipQuickConfigBlock}
<div id="membership" class="crm-group membership-group">
{if $context EQ "makeContribution"}
<div id="priceset">