Printing Order Tags in One Line With Coma

Hi There,

I want to print the order tags in one line instead of list… can someone please help me send the template for that?
I tried everything in the post below but nothing solved the issue…

I am using Zebra gx 420d Printer to print labels but its not giving me result properly and i can only use text printer type print!

Really appreciate that!

Regards

Farrukh

There is an order tag list printing tag isnt there?

Use this script to print the list of order tags:

2020-09-14_06;41_1600087316_Samba.Presentation

function toList(json)
{
  var jsonObj = JSON.parse(json);
  var r = '';
  
  for (var i = 0; i < jsonObj.length; i++)
  {
    if (i == jsonObj.length -1)
    {
      r = r + jsonObj[i].TV;
    }
    else
    {
      r = r + jsonObj[i].TV + ', ';
    }
  }
  
  return r;
}

Place {CALL:orderTags.toList('{ORDER TAG JSON}')} in your printer template where you want to show the list.

Like this:

[ORDERS]
<J00>{QUANTITY} {NAME}| L. [=F(TN('{TOTAL AMOUNT}'))]
<J00>{CALL:orderTags.toList('{ORDER TAG JSON}')}

1 Bacon Cheeseburger                                                    L. 265.00
Medium, Cheddar, Tomato, Onion, Pickle, Side Salad, Mustard, Ketchup
2 Likes

Hi @Memo, Thanks a lot
I tried adding the script but it still gives me a list instead of one line… can you please check if i am still missing any part?

image

Thanks a lot

 <EB>

[LAYOUT]

<div style="font-weight:normal;text-align:left;font-size:10px">

<L22> {TICKET TYPE}
<L00> Date:{TICKET DATE}| Time:{TIME}| Ticket# {TICKET NO}
<L00> {ENTITIES}

<F>-
{ORDERS}
[ORDERS]
<J00>{QUANTITY} {NAME}| L. [=F(TN('{TOTAL AMOUNT}'))]
<J00>{CALL:orderTags.toList('{ORDER TAG JSON}')}

{ORDER TAGS}
{ORDER TAG NAME},
<C22>  ({ORDER INDEX}/{INDEX TOTAL})

<L00>

[ORDER TAGS]
-- Format for order tags
<L00>     * {ORDER TAG NAME}[ENTITIES:Customer]

[ENTITIES:Customer]
-- Customer entity format
<L00>{ENTITY DATA:Name} | {ENTITY NAME:Customer} | {ENTITY DATA:Address}

With {ORDER TAGS} and {ORDER TAG NAME} under [ORDERS] the order tags were still being processed as formatted under [ORDER TAGS]

{} call [] so when you see {ORDERS} the program will be looking to [ORDERS] to see what should be displayed (if anything)

Give this a shot:

[LAYOUT]
<EB>
<L22> {TICKET TYPE}
<L00> Date:{TICKET DATE}| Time:{TIME}| Ticket# {TICKET NO}
<L00> {ENTITIES}
<F>-
{ORDERS}

[ORDERS]
<J00>{QUANTITY} {NAME}| L. [=F(TN('{TOTAL AMOUNT}'))]
<J00>{CALL:orderTags.toList('{ORDER TAG JSON}')}
<C22>  ({ORDER INDEX}/{INDEX TOTAL})

<L00>

[ORDER TAGS]
-- Format for order tags
<L00>     * {ORDER TAG NAME}

[ENTITIES:Customer]
-- Customer entity format
<L00>{ENTITY DATA:Name} | {ENTITY NAME:Customer} | {ENTITY DATA:Address}

Thanks @Memo for the quick response… i tried that one too but it doesnt show tags at all

image

Handler name for the script is case sensitive. The original called orderTags.toList where as configure it should be OrderTags.toList

This should work:

[LAYOUT]
<EB>
<L22> {TICKET TYPE}
<L00> Date:{TICKET DATE}| Time:{TIME}| Ticket# {TICKET NO}
<L00> {ENTITIES}
<F>-
{ORDERS}

[ORDERS]
<J00>{QUANTITY} {NAME}| L. [=F(TN('{TOTAL AMOUNT}'))]
<J00>{CALL:OrderTags.toList('{ORDER TAG JSON}')}
<C22>  ({ORDER INDEX}/{INDEX TOTAL})

<L00>

[ORDER TAGS]
-- Format for order tags
<L00>     * {ORDER TAG NAME}

[ENTITIES:Customer]
-- Customer entity format
<L00>{ENTITY DATA:Name} | {ENTITY NAME:Customer} | {ENTITY DATA:Address}

BTW the 'L.' on the <J00>{QUANTITY} {NAME}| L. [=F(TN('{TOTAL AMOUNT}'))] line is a currency symbol. Change to your local needs.

:frowning: nope

I’m stumped. Script is the same, template is the same

Did you logout and login again after adding the script?

@Memo Yes i did… nothing solved the issue…! can you have a look if i give you anydesk id and if you dont mind?

Thanks

I should be able to do that. Let me download anydesk first, I’ve never used it. I’m in the middle of some coding right now so it may be a bit. I’ll send you a message when I have a free moment.

i really appreciate that man