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.
- From your Shopify admin navigate to Settings > Notifications.
- Click on Customer notifications.
- In the Order processing section, and click on the Shipping confirmation notification.
- Click the Edit Code button.
- Find the following code block:
{% if line.line_item.refunded_quantity 0 %} <span class="order-list__item-refunded">Refunded</span> {% endif %}
- 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 %}
- Click Save.