Answers.Body: <p>Had to make a few template changes.
  Line 80:</p>
  <pre><code> {foreach from=$lineItems item=line}
        &lt;tr&gt;
          &lt;td {$labelStyle}&gt;
           {if {membership.membership_type_id}}
                 {ts 1=$line.label} %1 {/ts}
            {else}
              {ts}Contribution Amount{/ts}
            {/if}
          &lt;/td&gt;
          &lt;td {$valueStyle}&gt;
            {$line.line_total_inclusive|crmMoney:'{contribution.currency}'}
          &lt;/td&gt;
        &lt;/tr&gt;
      {/foreach}
  </code></pre>
  <p>Line 168:</p>
  <pre><code>{ts}Total Amount{/ts}
  </code></pre>
  <p>Now it looks right (changes highlighted in green) - both membership Type label and an Optional Donation label, plus, the &quot;Amount&quot; becomes the &quot;Total Amount&quot;.</p>
  <p>Would've supposed a patch, but the template here <a href="https://lab.civicrm.org/dev/core/-/blob/master/xml/templates/message_templates/membership_online_receipt_html.tpl?ref_type=heads" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/-/blob/master/xml/templates/message_templates/membership_online_receipt_html.tpl?ref_type=heads</a>  has totally different code so, perhaps, is not the right place.</p>
  <p><a href="https://i.sstatic.net/E09Sh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/E09Sh.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-03-24T17:04:06.580Z
Answers.LastActivityDate: 2024-03-24T17:04:06.580Z
Answers.UserDisplayName: yurg
Body: <p>The &quot;Memberships - Receipt (on-line)&quot; template, the code below causes 3 &quot;amount&quot; rows and a Membership Type label doesn't seem to be shown, also there is no &quot;Membership Type&quot; token available for the template. A bug perhaps?</p>
  <p><em>CiviCRM  5.70.2 - 5.71.1, Wordpress.</em></p>
  <pre><code>      {foreach from=$lineItems item=line}
        &lt;tr&gt;
          &lt;td {$labelStyle}&gt;
            {if $line.membership_type_id}
              {ts 1=&quot;{membership.membership_type_id:label}&quot;}%1 Membership{/ts}
            {else}
              {ts}Contribution Amount{/ts}
            {/if}
          &lt;/td&gt;
          &lt;td {$valueStyle}&gt;
            {$line.line_total_inclusive|crmMoney:'{contribution.currency}'}
          &lt;/td&gt;
        &lt;/tr&gt;
      {/foreach}
  </code></pre>
  <p><a href="https://i.sstatic.net/GhzK6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/GhzK6.png" alt="enter image description here" /></a></p>
  
Tags: <civimember><message-templates><receipts>
Title: Memberships - Receipt (on-line): multiple "amount" rows under Membership Fee
ThreadText: # Memberships - Receipt (on-line): multiple "amount" rows under Membership Fee
  
  (Asked by: username_0 on 2024-03-23)
  
  The "Memberships - Receipt (on-line)" template, the code below causes 3 "amount" rows and a Membership Type label doesn't seem to be shown, also there is no "Membership Type" token available for the template. A bug perhaps?
  
  *CiviCRM 5.70.2 - 5.71.1, Wordpress.*
  
  ```
        {foreach from=$lineItems item=line}
        <tr>
          <td {$labelStyle}>
            {if $line.membership_type_id}
              {ts 1="{membership.membership_type_id:label}"}%1 Membership{/ts}
            {else}
              {ts}Contribution Amount{/ts}
            {/if}
          </td>
          <td {$valueStyle}>
            {$line.line_total_inclusive|crmMoney:'{contribution.currency}'}
          </td>
        </tr>
      {/foreach}
  
  ```
  
  [![enter image description here](https://i.sstatic.net/GhzK6.png)](https://i.sstatic.net/GhzK6.png)
  
  **Tags:** civimember, message-templates, receipts
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-03-24. Score: 0
  
  Had to make a few template changes.
  Line 80:
  
  ```
   {foreach from=$lineItems item=line}
        <tr>
          <td {$labelStyle}>
           {if {membership.membership_type_id}}
                 {ts 1=$line.label} %1 {/ts}
            {else}
              {ts}Contribution Amount{/ts}
            {/if}
          </td>
          <td {$valueStyle}>
            {$line.line_total_inclusive|crmMoney:'{contribution.currency}'}
          </td>
        </tr>
      {/foreach}
  
  ```
  
  Line 168:
  
  ```
  {ts}Total Amount{/ts}
  
  ```
  
  Now it looks right (changes highlighted in green) - both membership Type label and an Optional Donation label, plus, the "Amount" becomes the "Total Amount".
  
  Would've supposed a patch, but the template here <https://lab.civicrm.org/dev/core/-/blob/master/xml/templates/message_templates/membership_online_receipt_html.tpl?ref_type=heads> has totally different code so, perhaps, is not the right place.
  
  [![enter image description here](https://i.sstatic.net/E09Sh.png)](https://i.sstatic.net/E09Sh.png)
  
  
  ---
  
  