(dev/core#3732) Show billing address on Edit contribution screen as well
authoryashodha <yashodha@cividesk.com>
Mon, 18 Jul 2022 09:13:13 +0000 (14:43 +0530)
committeryashodha <yashodha@cividesk.com>
Mon, 26 Sep 2022 14:38:13 +0000 (20:08 +0530)
CRM/Contribute/Form/Contribution.php
templates/CRM/Contribute/Form/Contribution.tpl

index 60cc09158160414df60acade19289de7668533b4..7be876efb9f255eb142b900483e0c71854dfaeef 100644 (file)
@@ -465,6 +465,14 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
       $defaults['campaign_id'] = $this->_pledgeValues['campaign_id'];
     }
 
+    $billing_address = '';
+    if (!empty($defaults['address_id'])) {
+      $addressDetails = CRM_Core_BAO_Address::getValues(['id' => $defaults['address_id']], FALSE, 'id');
+      $addressDetails = array_values($addressDetails);
+      $billing_address = $addressDetails[0]['display'];
+    }
+    $this->assign('billing_address', $billing_address);
+
     $this->_defaults = $defaults;
     return $defaults;
   }
index af2ec9f53f49f585ecf2c3533331edcb24ad9646..87157abdfb42dd992f8ffa56d6bf0db39daf2212 100644 (file)
         {/foreach}
       </div>
     {/if}
+    {if $billing_address}
+      <fieldset>
+        <legend>{ts}Billing Address{/ts}</legend>
+        <div class="form-item">
+          {$billing_address|nl2br}
+        </div>
+      </fieldset>
+    {/if}
     <br />
     <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
   </div>