Blog
Author: Sonya
01-26-2025 9:33 AMBackground
Adding a custom message to your packing slip template can significantly enhance your customer's shopping experience. This feature allows your customers to leave a note for a product specifically, sharing their requirements with you. This is especially helpful if you provide customization services such as engraving on a product, for example, on a pen or a box. Or it can be used to include gift messages, special handling instructions, or dietary preferences if you're selling consumable goods. The idea originated from a Shopify community post where users discussed ways to show their order note on the packing slips to better satisfy the customers.
Step-by-Step Guide
Before making any code modifications, always ensure you create a copy of the theme first. Test all your changes on this copy to confirm everything works perfectly before publishing it to the live theme. This precaution helps prevent any issues from affecting your main theme and keeps your work safe.
Add the Custom Message Field to Your Product Page:
Open your product page's code, typically found in main-product.liquid.
Insert the following code snippet to add a custom message field:
<p class="line-item-property__field"> <label for="message">Message</label> <input id="message" type="text" name="properties[message]" form="{{ product_form_id }}"> </p>
Edit Your Packing Slip Template:
Go to your Shopify admin panel.
Navigate to Settings > Shipping and Delivery.
Click on Edit Packing Slip Template.
Paste the following code into the template:
{%- for property in line_item.properties -%} {%- assign property_first_char = property.first | slice: 0 -%} {%- if property.last != blank and property_first_char != '_' -%} <span class="line-item-description-line"> {{ property.first }}:{{ property.last }} </span> {%- break -%} {%- endif -%} {%- endfor -%}
By following these steps, you can successfully add a custom message to your packing slip template, enhancing your customer's experience and reinforcing your brand identity.
Additional Examples:
Gift Messages: Allow customers to add personalized notes when sending gifts.
Special Handling Instructions: Useful for fragile items or specific delivery requirements.
Dietary Preferences: For businesses selling food products, allow customers to specify any dietary restrictions or preferences.
Implementing this feature can increase customer satisfaction and loyalty by providing a more personalized shopping experience. Happy coding!
For any questions or further assistance, please don't hesitate to reach out. Simply leave us a message, and we will respond to you as soon as possible. We're here to help and look forward to working with you!