Body: <p>I have an online membership form which takes an alternate (custom location type) address in a profile. On the receipts, these fields are always empty whether the user has filled them out or not (although the address does seem to populate in their contact record with the correct location type):</p>
  
  <p><a href="https://i.sstatic.net/YorRR.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/YorRR.jpg" alt="Receipt without address"></a></p>
  
  <p>Is there a trick to this, or is this a bug in the receipt template? I looked in the Message Template area and didn't see anything that was obviously awry, especially since the field names (<code>customName</code>) seem to show up just fine:</p>
  
  <pre><code> {if $customPre}
    &lt;tr&gt;
     &lt;th {$headerStyle}&gt;
      {$customPre_grouptitle}
     &lt;/th&gt;
    &lt;/tr&gt;
    {foreach from=$customPre item=customValue key=customName}
     {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields}
      &lt;tr&gt;
       &lt;td {$labelStyle}&gt;
        {$customName}
       &lt;/td&gt;
       &lt;td {$valueStyle}&gt;
        {$customValue}
       &lt;/td&gt;
      &lt;/tr&gt;
     {/if}
    {/foreach}
   {/if}
  </code></pre>
  
  <p>I've just updated to CiviCRM 5.8.2 to make sure it's not due to a bug that has been recently fixed.</p>
  
  <p>PHP 7.0.33
  CiviCRM 5.8.2
  Drupal 7.60</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-06T22:15:47.043Z
Comments.Text: Are you saying it is not a case that it is printing the Primary Address?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-07T17:53:59.070Z
Comments.Text: @petednz-fuzion The billing address gets included, but the "Delivery" address (custom location type and not necessarily a primary address, collected in a standard CiviCRM profile/form) is always blank on the receipt. I just checked and it looks like the billing address ends up marked as the primary address after submitting the Contrib. form.
Comments.UserDisplayName: Laryn
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-07T19:31:10.140Z
Comments.Text: does the "Yes, please" field get filled in on the receipt if data was entered?
Comments.UserDisplayName: petednz - fuzion
Tags: <civimember><receipts>
Title: Online Membership receipt doesn't show address fields from Profiles
ThreadText: # Online Membership receipt doesn't show address fields from Profiles
  
  (Asked by: username_0 on 2019-01-02)
  
  I have an online membership form which takes an alternate (custom location type) address in a profile. On the receipts, these fields are always empty whether the user has filled them out or not (although the address does seem to populate in their contact record with the correct location type):
  
  [![Receipt without address](https://i.sstatic.net/YorRR.jpg)](https://i.sstatic.net/YorRR.jpg)
  
  Is there a trick to this, or is this a bug in the receipt template? I looked in the Message Template area and didn't see anything that was obviously awry, especially since the field names (`customName`) seem to show up just fine:
  
  ```
   {if $customPre}
    <tr>
     <th {$headerStyle}>
      {$customPre_grouptitle}
     </th>
    </tr>
    {foreach from=$customPre item=customValue key=customName}
     {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields}
      <tr>
       <td {$labelStyle}>
        {$customName}
       </td>
       <td {$valueStyle}>
        {$customValue}
       </td>
      </tr>
     {/if}
    {/foreach}
   {/if}
  
  ```
  
  I've just updated to CiviCRM 5.8.2 to make sure it's not due to a bug that has been recently fixed.
  
  PHP 7.0.33
  CiviCRM 5.8.2
  Drupal 7.60
  
  **Tags:** civimember, receipts
  
  > **Comments:**
  > **username_1**: Are you saying it is not a case that it is printing the Primary Address?  
  > **username_0**: @username_1 The billing address gets included, but the "Delivery" address (custom location type and not necessarily a primary address, collected in a standard CiviCRM profile/form) is always blank on the receipt. I just checked and it looks like the billing address ends up marked as the primary address after submitting the Contrib. form.  
  > **username_1**: does the "Yes, please" field get filled in on the receipt if data was entered?  
  
  ---
  
  ## 0 answers
  
  