Integrate PDF link with the legacy customer accounts

Learn how to add a PDF download link for orders to your Shopify store's legacy customer account page. This guide is for users comfortable with editing theme code.

This guide requires technical skills in editing Shopify theme code. If you are not comfortable with making these changes, please contact our support team for assistance.

What are legacy customer accounts?

Shopify has updated its customer account functionality and now recommends using the New customer accounts. Our app is fully compatible with and also recommends using this new system for the best experience.

This guide is intended for stores that are still using the legacy version. For new customer accounts version, please check this article.

Open the theme code editor

To get started, you need to access your theme editor

Create a new snippet

You will now create a new snippet file snippets/doran-op-link.liquid that contains the logic for displaying the PDF link.

...
doran-op-link.liquid
...
doran-op-link.liquid
{%- unless template_id == blank or order_id == blank -%}
<a
  href="https://{{ shop.permanent_domain }}/apps/op_doran/print/{{ template_id }}/{{ order_id }}"
  style="padding: 12px 24px; background-color: #000000; color: white; border: none; border-radius: 5px; font-size: 16px; font-weight: bold; cursor: pointer;"
>
  Download Invoice
</a>
{%- endunless -%}

Render the snippet

After creating the snippet, you need to include it on the customer order page so the link becomes visible to your customers.

{%- render "doran-op-link", template_id: "[Template ID]", order_id: order.id -%}

The code above includes a placeholder variable, [Template ID], which you must replace with your actual Template ID. Please read this article to copy it.

On this page

Need help?

You are having problems and need our support. Please contact us here.