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%}
As a business owner, have you ever wondered when your customer's first impression of yo...
By Skye Jun 6, 2023We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023