All things Shopify and commerce
I am editing the packing slip, but all the variables in it are "line item" and not by product. For example:
{% if line_item.variant_title != blank %}
<span class="line-item-description-line">
{{ line_item.variant_title }}
</span>
{% endif %}
This means I cannot use the liquid variable product.description since it is not part of the line item object. Any help?
Or any add-on where I can put description to print out orders?
Or, how can I make the for loop to accommodate the product object?
Did you ever find a solution to this? I'm trying to so the same thing. I'd like to add the complete product description to the packing slip.
I am running into the same problem. how did you resolve this?
I tried inserting this code in the liquid packing slip template and we have the description showing up now. it's the red text inserted between the existing sections. if it doesnt work i might not have copied or highlighted enough of the code; lmk and i'll copy more of it for you. it's not elegant but it did work for us.
{% if line_item.variant_title != blank %}
<span class="line-item-description-line">
{{ line_item.variant_title }}
</span>
{% endif %}
{% if line_item.sku != blank %}
<span class="line-item-description-line">
{{ line_item.sku }}
</span>
{% endif %}
<span class="line-item-description-line">
{% assign product_description = nil %}
{% for item in order.line_items %}
{% if item.sku == line_item.sku %}
{% assign product_description = item.product.description %}
{% endif %}
{% endfor %}
{% if product_description %}
{{ product_description }}
{% endif %}
</span>
</p>
</div>
<div class="flex-line-item-quantity">
<p class="text-align-right">
{{ line_item.shipping_quantity }} of {{ line_item.quantity }}
Thank you for this code! I just copied and pasted it to our packing slip code and it is almost what we need. For some reason the description is the same for each product, it's not the unique product description. So if someone orders three different products, the same descriptions appears, but they should be different. Any idea how to fix this? I added a copy of the packing slip so you can see what I'm talking about. I removed the shipping and billing info for privacy. Those normally show up just fine.
Please put
{% assign product_description = nil %}
Inside forloop
Still finding a problem with this. Can you clarify what the code should look like? This would help us a great deal! Thanks everyone
Thank you so much Roma2 - this worked for me and now I can include detailed product description from web site without having to retype it!
If you have a more complete version of this code that you could share, that would be great. I can't get this snippet to do anything.
Hi there, just added this code and the description shows up on the packing slip.
But when I have two or more products in an order, the description is the same for each product.
Do you know how I can fix that?
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024