Solved! Go to the solution
Hi @greiseve,
I understand that you're trying to attach a PDF to your invoices only if a customers buys a certain product.
This is possible within Shopify by writing custom code for your Draft order invoice email notification template. The code would look for a particular product within the order and, if found, include the PDF link.
This solution works best if you're targeting one or a limited selection of products. However, if you have a lot of products needing unique PDF links, it's probably a better idea to look for an app to solve this.
Are you targeting one or multiple products? Does every product being targeted have the same PDF link?
If you're willing to describe your use case for this in detail, the community can point you in the right direction.
Cheers!
Brian | Shopify Partner | Ecommerce Consultant
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution
- Need further assistance? Visit www.BrianAtWork.com
@greiseve Yes, it's a fairly simple line of code like an if/then.
When you say one product category, and matching for that category – how are you doing the matching or defining the category? By collection, tag, vendor?
Brian | Shopify Partner | Ecommerce Consultant
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution
- Need further assistance? Visit www.BrianAtWork.com
Success.
@greiseve Okay, try this out in your invoice notification template:
Notes:
{% assign show_PDF_link = false %} {% for line in subtotal_line_items %} {% for collection in line.product.collections %} {% if collection.title == 'YOUR_COLLECTION_NAME_GOES_HERE' %} {% assign show_PDF_link = true %} {% endif %} {% endfor %} {% endfor %} {% if show_PDF_link == true %} <p><a href="YOUR_PDF_URL_GOES_HERE">Click here to download your PDF file.</a></p> {% endif %}
Let me know if this solves your problem or if you need further help!
Brian | Shopify Partner | Ecommerce Consultant
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution
- Need further assistance? Visit www.BrianAtWork.com
Subject | Author | Latest Post |
---|---|---|
Subject | Author | Posted |
---|---|---|
12-05-2019 11:01 AM | ||
11-30-2019 06:49 AM | ||
11-30-2019 06:18 AM | ||
11-30-2019 05:59 AM | ||
11-30-2019 05:45 AM |
User | Count |
---|---|
11 | |
7 | |
5 | |
3 | |
3 |