Answers.Body: <p>You can edit the contribution receipt under <strong>Mailings menu » Message Templates</strong>, <strong>System Workflow Messages</strong> tab.  You can insert a conditional in the Smarty to exclude a line based on one or more variables in it.  E.g. in the Online Receipt, the Smarty that generates the line items is pasted below.  You could put <code>{if $line.description eq 'Contribution Amount'}</code>  just under the <code>foreach</code> with a closing tag at the bottom and it should omit this line.</p>
  
  <pre><code>{foreach from=$value item=line}
              &lt;tr&gt;
               &lt;td&gt;
               {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}&lt;div&gt;{$line.description|truncate:30:"..."}&lt;/div&gt;{/if}
               &lt;/td&gt;
               &lt;td&gt;
                {$line.qty}
               &lt;/td&gt;
               &lt;td&gt;
                {$line.unit_price|crmMoney:$currency}
               &lt;/td&gt;
               {if $getTaxDetails}
                &lt;td&gt;
                 {$line.unit_price*$line.qty|crmMoney:$currency}
                &lt;/td&gt;
                {if $line.tax_rate != "" || $line.tax_amount != ""}
                 &lt;td&gt;
                  {$line.tax_rate|string_format:"%.2f"}%
                 &lt;/td&gt;
                 &lt;td&gt;
                  {$line.tax_amount|crmMoney:$currency}
                 &lt;/td&gt;
                {else}
                 &lt;td&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;/td&gt;
                {/if}
               {/if}
               &lt;td&gt;
                {$line.line_total+$line.tax_amount|crmMoney:$currency}
               &lt;/td&gt;
              &lt;/tr&gt;
             {/foreach}
            &lt;/table&gt;
           &lt;/td&gt;
          &lt;/tr&gt;
         {/foreach}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-29T02:21:43.407Z
Answers.Text: Thanks a lot for the answer, I am aware of this method, but I was rather looking into the reason for the "Contribution Amount" added in the line item as we actually don't have anything in the price set which should display it on the line item. If you can help me debug it and fix it it would be helpful so we reach to an ideal solution.
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-28T14:38:35.713Z
Answers.LastActivityDate: 2019-06-28T14:38:35.713Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <ol>
  <li><p>Added a Price Set.
  <a href="https://i.sstatic.net/YFXjF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/YFXjF.png" alt="enter image description here" /></a></p>
  </li>
  <li><p>Go to Contribution Page and the Receipt Email shows all the Price Set Items but along with it also shows Contribution Amount.</p>
  <p>Before Adding defaultPriceSet from the above-mentioned method the $lineitem array structure is as given below</p>
  </li>
  </ol>
  <blockquote>
  <pre><code>[line_item] =&gt; Array
          (
              [5] =&gt; Array
                  (
                      [25] =&gt; Array
                          (
                              [price_field_id] =&gt; 9
                              [price_field_value_id] =&gt; 25
                              [label] =&gt; Guidebook 1 Cooktown to Gunnawarra
                              [field_title] =&gt; guidebook selection
                              [description] =&gt; 
                              [qty] =&gt; 1
                              [unit_price] =&gt; 30.000000000
                              [line_total] =&gt; 30
                              [participant_count] =&gt; 0
                              [max_value] =&gt; 
                              [membership_type_id] =&gt; 
                              [membership_num_terms] =&gt; 
                              [auto_renew] =&gt; 
                              [html_type] =&gt; CheckBox
                              [financial_type_id] =&gt; 5
                              [tax_amount] =&gt; 0
                              [non_deductible_amount] =&gt; 0.00
                              [tax_rate] =&gt; 0.00000000
                          )
                  [32] =&gt; Array
                      (
                          [price_field_id] =&gt; 10
                          [price_field_value_id] =&gt; 32
                          [label] =&gt; Up to 125 g (Weekenders)
                          [field_title] =&gt; Postage and Handling
                          [description] =&gt; 
                          [qty] =&gt; 1
                          [unit_price] =&gt; 5.000000000
                          [line_total] =&gt; 5
                          [participant_count] =&gt; 0
                          [max_value] =&gt; 
                          [membership_type_id] =&gt; 
                          [membership_num_terms] =&gt; 
                          [auto_renew] =&gt; 
                          [html_type] =&gt; Select
                          [financial_type_id] =&gt; 5
                          [tax_amount] =&gt; 0
                          [non_deductible_amount] =&gt; 0.00
                          [tax_rate] =&gt; 0.00000000
                      )
  
  
                 [74] =&gt; Array
                      (
                          [price_field_id] =&gt; 21
                          [price_field_value_id] =&gt; 74
                          [label] =&gt; Cap
                          [field_title] =&gt; Cap
                          [description] =&gt; 
                          [qty] =&gt; 1
                          [unit_price] =&gt; 20.000000000
                          [line_total] =&gt; 20
                          [participant_count] =&gt; 0
                          [max_value] =&gt; 
                          [membership_type_id] =&gt; 
                          [membership_num_terms] =&gt; 
                          [auto_renew] =&gt; 
                          [html_type] =&gt; Text
                          [financial_type_id] =&gt; 5
                          [tax_amount] =&gt; 0
                          [non_deductible_amount] =&gt; 0.00
                          [tax_rate] =&gt; 0.00000000
                      )
  
                  [75] =&gt; Array
                      (
                          [price_field_id] =&gt; 22
                          [price_field_value_id] =&gt; 75
                          [label] =&gt; BNT Sticker
                          [field_title] =&gt; BNT Sticker
                          [description] =&gt; 
                          [qty] =&gt; 2
                          [unit_price] =&gt; 4.000000000
                          [line_total] =&gt; 8
                          [participant_count] =&gt; 0
                          [max_value] =&gt; 
                          [membership_type_id] =&gt; 
                          [membership_num_terms] =&gt; 
                          [auto_renew] =&gt; 
                          [html_type] =&gt; Text
                          [financial_type_id] =&gt; 5
                          [tax_amount] =&gt; 0
                          [non_deductible_amount] =&gt; 0.00
                          [tax_rate] =&gt; 0.00000000
                      )
  
                  [76] =&gt; Array
                      (
                          [price_field_id] =&gt; 23
                          [price_field_value_id] =&gt; 76
                          [label] =&gt; Badge/Hat Pin
                          [field_title] =&gt; Badge/Hat Pin
                          [description] =&gt; 
                          [qty] =&gt; 2
                          [unit_price] =&gt; 10.000000000
                          [line_total] =&gt; 20
                          [participant_count] =&gt; 0
                          [max_value] =&gt; 
                          [membership_type_id] =&gt; 
                          [membership_num_terms] =&gt; 
                          [auto_renew] =&gt; 
                          [html_type] =&gt; Text
                          [financial_type_id] =&gt; 5
                          [tax_amount] =&gt; 0
                          [non_deductible_amount] =&gt; 0.00
                          [tax_rate] =&gt; 0.00000000
                      )
  
              )
  </code></pre>
  </blockquote>
  <p>After adding defaultPriceSet it adds New Line Item which is as given below</p>
  <pre><code>(
      [1] =&gt; Array
          (
              [setID] =&gt; 1
              [priceFieldID] =&gt; 1
              [name] =&gt; contribution_amount
              [label] =&gt; Contribution Amount
              [priceFieldValueID] =&gt; 1
              [membership_type_id] =&gt; 
              [amount] =&gt; 1.000000000
              [financial_type_id] =&gt; 1
          )
  
  )
  </code></pre>
  <p>How to get rid of this line item as it seems to show that user is charged twice as seen in below screenshot of email receipt
  Ignore the price value ,just look into the Contribution Amount row the total of which is same as the total of other items in the table so I need to exclude Contribution Amount from the table of Receipt,what is the correct way to remove that.?
  <a href="https://i.sstatic.net/5EyJF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/5EyJF.png" alt="enter image description here" /></a></p>
  <ol start="3">
  <li>I debugged and found that code under CRM/Price/BAO/PriceSet  <code>CRM_Price_BAO_PriceSet</code> has a method which adds the row in the line item <code>getDefaultPriceSet</code>.
  This method generates the Contribution Amount array, how to skip this so Email Receipt looks clean?</li>
  </ol>
  <p>where when I use a Price Set with multiple values</p>
  <p>checkbox values
  Material A $20.</p>
  <p>select list
  Material B $30</p>
  <p>textfield with quantity
  Material C:-  1 * $20  = $20
  the Receipt it prints has following rows
  Material A . $20<br>
  Contribution Amount $70 (which is total of $20 + $30+ $20)<br>
  Material B .  $30<br>
  Material C    $20<br></p>
  <p>(edited)
  For a user point of view this looks very confusing<br>
  as Material A, Material B and Material C is already listed and . it does<br> not make sense to print Contribution Amount
  I am using Civicrm 5.13.4 version</p>
  
Tags: <contributions><price-sets><receipts>
Title: Unwanted "Contribution Amount" appears in Line Item which makes it look like its incorrect
ThreadText: # Unwanted "Contribution Amount" appears in Line Item which makes it look like its incorrect
  
  (Asked by: username_0 on 2019-06-23)
  
  1. Added a Price Set.
     [![enter image description here](https://i.sstatic.net/YFXjF.png)](https://i.sstatic.net/YFXjF.png)
  2. Go to Contribution Page and the Receipt Email shows all the Price Set Items but along with it also shows Contribution Amount.
  
     Before Adding defaultPriceSet from the above-mentioned method the $lineitem array structure is as given below
  
  > ```
  > [line_item] => Array
  >         (
  >             [5] => Array
  >                 (
  >                     [25] => Array
  >                         (
  >                             [price_field_id] => 9
  >                             [price_field_value_id] => 25
  >                             [label] => Guidebook 1 Cooktown to Gunnawarra
  >                             [field_title] => guidebook selection
  >                             [description] => 
  >                             [qty] => 1
  >                             [unit_price] => 30.000000000
  >                             [line_total] => 30
  >                             [participant_count] => 0
  >                             [max_value] => 
  >                             [membership_type_id] => 
  >                             [membership_num_terms] => 
  >                             [auto_renew] => 
  >                             [html_type] => CheckBox
  >                             [financial_type_id] => 5
  >                             [tax_amount] => 0
  >                             [non_deductible_amount] => 0.00
  >                             [tax_rate] => 0.00000000
  >                         )
  >                 [32] => Array
  >                     (
  >                         [price_field_id] => 10
  >                         [price_field_value_id] => 32
  >                         [label] => Up to 125 g (Weekenders)
  >                         [field_title] => Postage and Handling
  >                         [description] => 
  >                         [qty] => 1
  >                         [unit_price] => 5.000000000
  >                         [line_total] => 5
  >                         [participant_count] => 0
  >                         [max_value] => 
  >                         [membership_type_id] => 
  >                         [membership_num_terms] => 
  >                         [auto_renew] => 
  >                         [html_type] => Select
  >                         [financial_type_id] => 5
  >                         [tax_amount] => 0
  >                         [non_deductible_amount] => 0.00
  >                         [tax_rate] => 0.00000000
  >                     )
  >
  >
  >                [74] => Array
  >                     (
  >                         [price_field_id] => 21
  >                         [price_field_value_id] => 74
  >                         [label] => Cap
  >                         [field_title] => Cap
  >                         [description] => 
  >                         [qty] => 1
  >                         [unit_price] => 20.000000000
  >                         [line_total] => 20
  >                         [participant_count] => 0
  >                         [max_value] => 
  >                         [membership_type_id] => 
  >                         [membership_num_terms] => 
  >                         [auto_renew] => 
  >                         [html_type] => Text
  >                         [financial_type_id] => 5
  >                         [tax_amount] => 0
  >                         [non_deductible_amount] => 0.00
  >                         [tax_rate] => 0.00000000
  >                     )
  >
  >                 [75] => Array
  >                     (
  >                         [price_field_id] => 22
  >                         [price_field_value_id] => 75
  >                         [label] => BNT Sticker
  >                         [field_title] => BNT Sticker
  >                         [description] => 
  >                         [qty] => 2
  >                         [unit_price] => 4.000000000
  >                         [line_total] => 8
  >                         [participant_count] => 0
  >                         [max_value] => 
  >                         [membership_type_id] => 
  >                         [membership_num_terms] => 
  >                         [auto_renew] => 
  >                         [html_type] => Text
  >                         [financial_type_id] => 5
  >                         [tax_amount] => 0
  >                         [non_deductible_amount] => 0.00
  >                         [tax_rate] => 0.00000000
  >                     )
  >
  >                 [76] => Array
  >                     (
  >                         [price_field_id] => 23
  >                         [price_field_value_id] => 76
  >                         [label] => Badge/Hat Pin
  >                         [field_title] => Badge/Hat Pin
  >                         [description] => 
  >                         [qty] => 2
  >                         [unit_price] => 10.000000000
  >                         [line_total] => 20
  >                         [participant_count] => 0
  >                         [max_value] => 
  >                         [membership_type_id] => 
  >                         [membership_num_terms] => 
  >                         [auto_renew] => 
  >                         [html_type] => Text
  >                         [financial_type_id] => 5
  >                         [tax_amount] => 0
  >                         [non_deductible_amount] => 0.00
  >                         [tax_rate] => 0.00000000
  >                     )
  >
  >             )
  >
  > ```
  
  After adding defaultPriceSet it adds New Line Item which is as given below
  
  ```
  (
      [1] => Array
          (
              [setID] => 1
              [priceFieldID] => 1
              [name] => contribution_amount
              [label] => Contribution Amount
              [priceFieldValueID] => 1
              [membership_type_id] => 
              [amount] => 1.000000000
              [financial_type_id] => 1
          )
  
  )
  
  ```
  
  How to get rid of this line item as it seems to show that user is charged twice as seen in below screenshot of email receipt
  Ignore the price value ,just look into the Contribution Amount row the total of which is same as the total of other items in the table so I need to exclude Contribution Amount from the table of Receipt,what is the correct way to remove that.?
  [![enter image description here](https://i.sstatic.net/5EyJF.png)](https://i.sstatic.net/5EyJF.png)
  
  3. I debugged and found that code under CRM/Price/BAO/PriceSet `CRM_Price_BAO_PriceSet` has a method which adds the row in the line item `getDefaultPriceSet`.
     This method generates the Contribution Amount array, how to skip this so Email Receipt looks clean?
  
  where when I use a Price Set with multiple values
  
  checkbox values
  Material A $20.
  
  select list
  Material B $30
  
  textfield with quantity
  Material C:- 1 \* $20 = $20
  the Receipt it prints has following rows
  Material A . $20  
  Contribution Amount $70 (which is total of $20 + $30+ $20)  
  Material B . $30  
  Material C $20
  
  (edited)
  For a user point of view this looks very confusing  
  as Material A, Material B and Material C is already listed and . it does  
   not make sense to print Contribution Amount
  I am using Civicrm 5.13.4 version
  
  **Tags:** contributions, price-sets, receipts
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-06-28. Score: 2
  
  You can edit the contribution receipt under **Mailings menu » Message Templates**, **System Workflow Messages** tab. You can insert a conditional in the Smarty to exclude a line based on one or more variables in it. E.g. in the Online Receipt, the Smarty that generates the line items is pasted below. You could put `{if $line.description eq 'Contribution Amount'}` just under the `foreach` with a closing tag at the bottom and it should omit this line.
  
  ```
  {foreach from=$value item=line}
              <tr>
               <td>
               {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div>{$line.description|truncate:30:"..."}</div>{/if}
               </td>
               <td>
                {$line.qty}
               </td>
               <td>
                {$line.unit_price|crmMoney:$currency}
               </td>
               {if $getTaxDetails}
                <td>
                 {$line.unit_price*$line.qty|crmMoney:$currency}
                </td>
                {if $line.tax_rate != "" || $line.tax_amount != ""}
                 <td>
                  {$line.tax_rate|string_format:"%.2f"}%
                 </td>
                 <td>
                  {$line.tax_amount|crmMoney:$currency}
                 </td>
                {else}
                 <td></td>
                 <td></td>
                {/if}
               {/if}
               <td>
                {$line.line_total+$line.tax_amount|crmMoney:$currency}
               </td>
              </tr>
             {/foreach}
            </table>
           </td>
          </tr>
         {/foreach}
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks a lot for the answer, I am aware of this method, but I was rather looking into the reason for the "Contribution Amount" added in the line item as we actually don't have anything in the price set which should display it on the line item. If you can help me debug it and fix it it would be helpful so we reach to an ideal solution.  
  
  ---
  
  