HS Tariff Code

Shopify Partner
5 0 1

What's the syntax to include the product (variant) HS Tariff Code in the line item on a custom invoice template (using the Shopify Order Printer app)?

Thanks! 

0 Likes
Shopify Staff
Shopify Staff
33 0 1

Hi there,

This isn't currently a feature but I am going to open a ticket for you and add it to our feature requests as I can see how this would be useful! 

Cheers,

Jenna | Support Guru
Shopify

 

0 Likes
Shopify Partner
4 0 0

Yes that would be really usefull.

In the meantime, LC, have you found a workaround?

Thanks

0 Likes
Shopify Partner
5 0 1

Hi Nicolas,

While we wait for Shopify to expose HS Tariff Code, our workaround is to use the Barcode field for the tariff code.  We added a column in the line item section of the invoice and use {{ line_item.variant.barcode }} .

LC

1 Like
Shopify Partner
106 0 11

Has this been changed?  A client of mine needs to put the HS Code on their invoices, and they may be using the barcode field for an actual barcode.

Shopify expert, software developer and designer.
0 Likes
Tourist
5 0 0

For HS Code 

{{ line_item.variant.metafields.harmonized_system_code.value }}

 is what we found

it's a metafield instead of an object or attribute

0 Likes
New Member
3 0 0

I'm losing my mind trying to get this to work because none of the other answers I've tried have worked. I even tried Steven's liquid code above.

 

Can anyone help me? Here's what I'm trying:

{{ line_item.variant.metafields.global.harmonized_system_code.value }}

 

I've also tried with no luck:

{{ line_item.variant.inventory_item.harmonized_system_code }}
0 Likes
New Member
3 0 0

Update: After a good night's rest and a lot of more wild attempts I finally got some code to work.

 

The primary place I'm using this is in an invoice template in Order Printer Pro where I can use Liquid.

 

The below code works in Order Printer Pro for regular products and variants, but it does not work on my theme's account/orders.liquid page:

 

{{ line_item.hs_tariff_code }}

And this code works in my theme's account/order.liquid page for regular products and variants, but it does not work in Order Printer Pro.

 

{{ line_item.variant.metafields.global.harmonized_system_code }}

 

If what I've read on other discussions is true, the metafields code may be deprecated soon, so if there's better code that would work for both pages, I'd be very interested in finding out.

 

 

0 Likes
New Member
4 0 0

Hey,

 

I'm trying to do the same thing but neither of these work for me in the Order Printer app. Is this still working for you?

 

I'm currently just trying to get anything to show so here's the code I'm using:

 

{% for line_item in line_items %}
            <tr>
                        <td class="tuotetiedot";><b>{{ line_item.title }}</b></td>
                        <td class="tuotetiedot";>{{ line_item.hs_tariff_code }}{{ line_item.variant.metafields.global.harmonized_system_code }}</td>
                        <td class="tuotetiedot";>{{ line_item.price | money }}</td>
              </tr>
{% endfor %}

Any help is greatly appreciated since having to do this manually for every order is something we wish to avoid.

0 Likes