简体   繁体   中英

Adding customer tags to order printer template in Shopify

Sorry, I only have a very basic understanding of liquid but I am trying to add customer tags to our printed orders via the Shopify Order Printer app. I have previously edited the template by referring to the liquid variable list but when adding the customer.tags variable it is not returning anything. The customer.tags variable is not shown in the reference for the order printer template but appears elsewhere so I'm not even sure if I can use in in this template. The provided syntax in the reference is

{% for tag in customers.tags %} {{ tag }} {% endfor %}

Any help would be greatly appreciated. . thanks

The Customer object within the Order Printer app only gives access to the following 2 properties:

{{ customer.name }}
{{ customer.email }}

Unfortunately customer tags are not supported within Order Printer.

You can see this by simply adding {{ customer }} to your Order Printer template, as it will then output the hash of properties available to you.

Something is fishy about your question. In your loop you are iterating through an object representing customers . Note the plural. There is no such thing in an order. An order has a customer, not has many customers. So if you know you have an Order object, you can almost but not always have access to a customer object. And if you do, you can probably iterate the tags since a customer has many tags.

Perhaps you should try things at the highest level and work your way down. Do you have an Order object? Does it have a Customer Object? If yes, does the Customer have tags?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM