All things Shopify and commerce
Sorry for the confusing title... Below is the code I wrote to add product descriptions relative to line items to invoices. The problem I can't seem to solve is that my products (beer) are divided into different units (can cases and kegs) and therefore if a can case and a keg of the same product occur on the invoice, the product description outputs twice.
Does anybody have any thoughts on how to make it so the description only outputs once?
Thanks!
{% for line_item in line_items %}
{% unless line_item.product.title contains 'Fee' %}
{% if line_item.product.title contains '(Can Case)' %}
<b>{{ line_item.product.title | remove: "(Can Case)"}}
{% elsif line_item.product.title contains '(1/6 Keg)' %}
<b>{{ line_item.product.title | remove: "(1/6 Keg)" }}
{% else %}
<b>{{ line_item.product.title | remove: "(1/2 Keg)" }}
{% endif %}
{{ line_item.product.description }}<br><br>
<p>-------------------------------------------------------------</p>
{% endunless %}
{%endfor%}
User | RANK |
---|---|
68 | |
49 | |
36 | |
34 | |
29 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022