We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Add a line item to packing slip to show gift message

Add a line item to packing slip to show gift message

TMG74
Visitor
1 0 0

Hi

I have created a new template called product.gift-product.json and an associated gift-product.liquid file. To the liquid file I have added the following code to create a field to collect a message to be included in a card.

 


{% comment %} added next 4 lines to add message collection box to gift template {% endcomment %}
<p class="line-item-property__field">
<label for="your-message">Card message</label><br>
<textarea rows="6" cols="60" id="your-message" name="properties[Your message]"></textarea>
</p>
 

It is included as part of the buy button. It results in the gift product looking like this.

 

Screenshot 2022-06-10 at 09.55.58.png

It works fine and adds the message to the order but I need it to display on the packing slip.

 

I have messed about with various line items such as the example below to try to get an output but can't get it to work.

 

 {% if line_item.your-message != blank %}
<span class="line-item-description-line">
{{ line_item.your-message }}
</span>
{% endif %}

 

What code should I be using? Any help appreciated. I am using Shopify 2.0 Taste theme

Replies 2 (2)

NigelClarke
Visitor
1 0 1

Hi, did you ever resolve this? I'm trying to achieve a similar result but struggling to find info.

Nige

OUICHEF
Tourist
4 0 0

Probably a bit late but might help someone else - this worked a treat for me

 

https://w3trends.zendesk.com/hc/en-us/articles/10800697251355-Edit-Packing-Slip-to-Include-Line-Item...