Replace ref to undeclared property with tax-inclusive lookup
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 21 Nov 2023 22:31:10 +0000 (11:31 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 21 Nov 2023 22:31:10 +0000 (11:31 +1300)
CRM/Contribute/Form/Contribution/Confirm.php

index 88bed9766ce99242928263a469a01b680da90995..6ab0aff649cee3d4934a98c63324616f9c0780ec 100644 (file)
@@ -690,7 +690,6 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
         }
 
         $membershipTypeValues = CRM_Member_BAO_Membership::buildMembershipTypeValues($this, $membershipTypeIds);
-        $this->_membershipTypeValues = $membershipTypeValues;
         $endDate = NULL;
 
         // Check if we support auto-renew on this contribution page
@@ -1130,15 +1129,13 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
 
     // CRM-14354: For an auto-renewing membership with an additional contribution,
     // if separate payments is not enabled, make sure only the membership fee recurs
-    if (!empty($this->_membershipBlock)
-      && $this->_membershipBlock['is_separate_payment'] === '0'
+    if ($this->isSeparateMembershipPayment()
       && isset($params['selectMembership'])
-      && $this->_values['is_allow_other_amount'] == '1'
+      && $this->getContributionPageValue('is_allow_other_amount')
       // CRM-16331
-      && !empty($this->_membershipTypeValues)
-      && !empty($this->_membershipTypeValues[$params['selectMembership']]['minimum_fee'])
+      && !empty($this->order->getMembershipTotalAmount())
     ) {
-      $recurParams['amount'] = $this->_membershipTypeValues[$params['selectMembership']]['minimum_fee'];
+      $recurParams['amount'] = $this->order->getMembershipTotalAmount();
     }
 
     $recurParams['is_test'] = 0;