Liquid, JavaScript, themes, sales channels
Hi there,
Does anyone have any idea what variable I would need to add to my packing slips to include the products location beside the name? I mocked up what I'm looking for quickly in photoshop so you get an idea:
Thanks,
Chelsea
Hi! No, I never got it sorted!
You need to make an order metafield with the product location information to display it on the order packing slip. You will need Shopify Flow to do this. It is free on the Shopify subscription and Shopify Advance subscription
I will number all the steps to keep it easy.
1. Go to /settings/custom_data/productvariant/metafields
Make the following metafield
variant.metafields.stock.bin (stock is the namespace and bin is the key)
It must be single line text.
2. Go to /settings/custom_data/order/metafields
Make the following metafield
order.metafields.stock.bin (stock is the namespace and bin is the key)
It must be single line text.
3. Make the flow to that will create the order metafield
Go to Sfopify Flow. Trigger will be Order Created. Action will be Update Order Metafield.
Then enter the following
Key is bin
Metafield namespace is stock
Value is
{% for lineItems_item in order.lineItems %}{% for metafields_item in lineItems_item.variant.metafields %}{% if metafields_item.key == 'bin' and metafields_item.key != '' %},{{ lineItems_item.sku }}:Bin:{{ metafields_item.value }}{% endif %}{% endfor %}{% endfor %}
Do not make any spaces or new lines in this code or it will not work. Copy and past it as is.
Type is multi line text.
4. Next you will add the code to your packing slip template.
Go to settings/ shipping and delivery /packing_slip_template, then edit.
Look for this code
{% if line_item.sku != blank %}
<span class="line-item-description-line">
{{ line_item.sku }}
{% endif %}
and replace it with this
{% if line_item.sku != blank %}
<span class="line-item-description-line">
{{ line_item.sku }}
{% assign sku_bin_pairs = order.metafields.stock.bin | split: ',' %}
{% for sku_bin_pair in sku_bin_pairs %}
{% assign sku_bin_info = sku_bin_pair | split: ':' %}
{% assign sku_info = sku_bin_info[0] %}
{% assign bin_info = sku_bin_info[2] %}
{% if sku_info == line_item.sku %}
<strong> | {{ bin_info }}</strong>
{% endif %}
{% endfor %}
</span>
{% endif %}
5. Nxt you need to fill in the product locations. Go to each product or product variant and at the bottom you will find the metafields and the bin. Enter your location here. The location that I used did not contain any spaces, like 1A45
This will only work on new orders once the flow created the order metafield with the product location that you entered.
It will look like this on your packing slip
SKU | Location
Let me know if you need help.
If this works for you please accept this as a solution.
User | RANK |
---|---|
25 | |
21 | |
8 | |
7 | |
6 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023