Discount Code applied to ALL products only shows on Admin notification

sean4949
New Member
1 0 0

On the admin notification, only the discount codes that are applied to all products show. When the discount code is applied to a specific product, it does not show, but the pricing is correct. How can I have any discount code showing on the admin notification? Below is the code that is in the notification email. 

 

{% assign discount_value = 0 %}
{% for discount_application in discount_applications %}
  {% if discount_application.target_selection == 'all' %}
      {% assign discount_value = discount_application.total_allocated_amount %}
  {% endif %}
{% endfor %}
        
<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      {% if titleBold %}
        <span><strong>Subtotal</strong></span>
      {% else %}
        <span>Subtotal</span>
      {% endif %}
    </p>
  </td>
  <td class="subtotal-line__value">
    {% if valueBold %}
      <strong>{{ subtotal_price | plus: discount_value | money }}</strong>
    {% else %}
      {{ subtotal_price | plus: discount_value | money }}
    {% endif %}  
  </td>
</tr>


        {% for discount_application in discount_applications %}
          {% if discount_application.target_selection == 'all' %}
            {% capture discount_title %}
              {% if discount_application.title %}
                {{ discount_application.title | upcase }}
              {% else %}
                Discount
              {% endif %}
            {% endcapture %}
            
<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      {% if titleBold %}
        <span><strong>Discount</strong></span>
      {% else %}
        <span>Discount</span>
      {% endif %}
        <span class="subtotal-line__discount">
          <span class="subtotal-line__discount-title">{% if discount_title.size > 0 %}({{ discount_title | strip }}){% endif %}</span>
        </span>
    </p>
  </td>
  <td class="subtotal-line__value">
    {% if valueBold %}
      <strong>-{{ discount_application.total_allocated_amount | money }}</strong>
    {% else %}
      -{{ discount_application.total_allocated_amount | money }}
    {% endif %}  
  </td>
</tr>

{% endif %}
{% endfor %}

  

Replies 0 (0)