Add a Reorder link on order confirmation emails

Add a Reorder link on order confirmation emails

Overview

Appify CPO stores a short hidden _state id on each customized line at add-to-cart. The order confirmation email can link to a shop-domain recover page that rebuilds that configuration and adds it to the clicker’s cart.

Shopify’s built-in reorder only posts a variant id and drops options.

For the full order-confirmation setup — custom options and Reorder, with a find-and-paste for every title in Shopify’s default template — use Set up the Order Confirmation Email.

What the customer sees

A Reorder this item link under a customized line. Clicking it opens https://your-store.com/apps/calculator-ai/reorder?state=…, briefly shows “Restoring your cart…”, then lands on /cart. If the published calculator changed, they review the filled-in options first.

Hide the link when _state is blank (orders placed before this feature).

Steps

  1. In Shopify admin go to Settings → Notifications, or open the template directly from the Appify dashboard setup card (Open order confirmation email).
  2. Open Order confirmation and click Edit code.
  3. Inside the line-item loop, after the product title (or next to the options you already added), paste:
<!-- APPIFY CPO REORDER -->
{% assign st = line.properties._state %}
{% if st == blank %}
  {% assign st = component.properties._state %}
{% endif %}
{% if st != blank %}
  <p><a href="{{ shop.url }}/apps/calculator-ai/reorder?state={{ st }}">Reorder this item</a></p>
{% endif %}
<!-- APPIFY CPO END REORDER -->
  1. Save. Wait about 30 seconds.

Use line.properties or component.properties depending on your template (newer Shopify templates use component).

The HTML comments mark the Appify CPO block. Search for APPIFY CPO REORDER later if you need to find or remove it.

Details

  • The URL stays on your shop so /cart/add.js uses that browser’s cart cookies.
  • Anyone with the email can click it; the item is added to their cart.
  • Fee and shipping-weight rows are recreated automatically when the product is re-added. Do not put Reorder on those rows.
  • Single-line reorder adds the product. It does not empty the cart.