0

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

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.