How to add shelf space data to products and show them in templates
It can be extremely beneficial to add your product shelf space data to your templates. It can make your order picking much more efficient.
First you'll need to add a custom metafield for your products. First go to Shopify admin -> settings -> custom data. For this example we use variant metafield so choose "Variants" from the list.
Then "Add definition". You can name your custom metafield anything but in this example we'll use "shelf space". If you want you can add a description to your metafield. Then choose type of the field. "Single line text" works perfect for this. Then just save.
After saving you can find your new metafield from your product variants. Now you can add your shelf space information to the line.
Now we can go and add this information to our templates. Go to Printrooster templates and choose a template where you want to add this information.
Adding metafields to orders template
To add the shelf space metafield we made before we need to add one line of custom code to our template. This is the code you'll need to add: {{ line_item.variant.metafields.custom.shelf_space }}. Please note that the end "custom.shelf_space" can be different for you depending how you named your metafield (namespace.key). Also this code is inside a for loop that loops line_items.
Adding metafields to Picking list template
For picking list template the code is a little bit different. You will also have to loop the picking list items. So search for the for loop in your template and inside that use this code:
{{ item.variant.metafields.custom.shelf_space }}. Please note that this code also has your metafields namespace and key at the end so it can vary depending how you named your metafield.
Congratulations now you have successfully added custom metafield data to your templates. If you have any troubles adding custom metafields please feel free to contact our support and we will help you.
Please note! In order to show metafields in a template you will need plan of "Unlimited" or above. Updating metafields does not launch product update hook. This can mean that your metafields possibly wont show in a template for 24 hours after updating them.