Make a selection

Customer's Product is Marked as Refunded in Shipping Confirmation Email

Laurel
Laurel
  • Updated

If a customer orders a prepaid subscription, they may see the product marked as refunded on the initial shipping notification. To prevent this from happening, you can make the following code edit to the shipping confirmation email template.

Note: The potential for this to happen occurs only on the initial order of a prepaid subscription and does not affect all stores. The following solution can be applied to any email notification that contains the Refunded code block (shown below in step 5) such as the Out for delivery notification. 

  1. From your Shopify admin navigate to Settings > Notifications.
  2. Click on Customer notifications.
  3. In the Order processing section, and click on the Shipping confirmation notification.
  4. Click the Edit Code button.
    Edit code
  5. Find the following code block:
    {% if line.line_item.refunded_quantity  0 %}
     <span class="order-list__item-refunded">Refunded</span>
    {% endif %}
    
  6. Replace it with the following code:
    {% assign line_refunded = false %}
    
    {% if order.total_refunded_amount  0 and order.refunds != blank %}
      {% for refund in order.refunds %}
        {% for refund_line_item in refund.refund_line_items %}
          {% if refund_line_item.line_item.id == line.line_item.id and line.line_item.refunded_quantity  0 %}
            {% assign line_refunded = true %}
          {% endif %}
        {% endfor %}
      {% endfor %}
    {% endif %}
    
    {% if line_refunded %}
      <span class="order-list__item-refunded">Refunded</span>
    {% endif %}
    
  7. Click Save.