question

mKonnekt avatar image
mKonnekt asked mKonnekt commented

Print online orders to respective printers

We are trying to figure out how the printer labels work - how can we assign items to appropriate printers based on the printer labels (assuming these labels are used by Clover PoS to direct orders to the right printer)

OrdersPrint
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian Deactivated answered

Have you seen our documentation here - https://www.clover.com/help/printer-labels/?

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mKonnekt avatar image
mKonnekt answered David Marginian Deactivated commented

David,
Thanks for the response. We are looking to assign printers for online orders - as they are printing to all printers irrespective of the printer label.

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·

Ok, can you provide details about how you are printing?

0 Likes 0 ·
mKonnekt avatar image
mKonnekt answered David Marginian Deactivated commented

Yes we are using this to Print job, by passing the order and all active printer object with it


PrintJob pj = new StaticOrderPrintJob.Builder().order(orderObject).build();

pj.print(context, account, printerObject);


and this to print job receipt

PrintJob pj = new StaticPaymentPrintJob.Builder().order(orderObject).build();

pj.print(context, account, printerObject);

5 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·

StaticOrderPrintJob is just a dumb print job, it prints what you tell it, doesn't honor labels (or tags), etc. If you want to honor tags you would need to obtain the tags and adjust the line items accordingly, a bit more information on how to obtain the tags - https://community.clover.com/questions/21552/is-there-any-update-on-getting-labels-connected-to.html..

If your app just prints then you should look at our newer REST API for printing which should honor tags - https://docs.clover.com/reference/ordercreateprintevent.. This API may allow you to remove your native app altogether (assuming your app's only role is printing).

1 Like 1 ·
Shubham Bhawsar avatar image Shubham Bhawsar David Marginian ♦♦ commented ·

Hie @David Marginian We have a android native clover application for our system, we are using these StaticOrderPrintJob and StaticPaymentPrintJob request to print the orders, it is successfully printing the order details, but at merchant stores they are using the different printers for differently labelled items , so is there any way to print the orders specific to printers based on the printer labels.

Because if they are ordering and printing through the clover order app then the items are printed specific to printers based on the printer labels, but in our receipts all items are printed on all connected printers

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ Shubham Bhawsar commented ·
Yes, you need to get the tags and adjust the line items as I mentioned above.
0 Likes 0 ·
Show more comments
mKonnekt avatar image
mKonnekt answered David Marginian Deactivated edited

Just to confirm with a native app, we cannot execute the specific items to print to specific printers?

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·

That is not what I said. It can be done but you are going to have to write some code and test that code.

I am still not 100% clear on what you want to do, honor tags/labels or print to a specified printer? The PrintJob interface has a print method that takes a printer (I am sorry, I assumed you were aware of this API since you are using StaticOrderPrintJob):

/**
 * Send this PrintJob to the specified printer.
 */
public void print(Context context, Account account, Printer printer) {
                    

So, you either need to allow your merchants to choose a printer where all online orders will print (via configuration) and then obtain and pass that printer in your app, or if you need to honor tags you need to retrieve the tag to printer map and do something similar (print only certain items to certain printers based on the tag/printer mapping).


0 Likes 0 ·
mkabhi avatar image
mkabhi answered David Marginian Deactivated commented

@David, here is the problem statement:


we have items labled say wine, and meat and we have 2 order printers. so if item has lable wine then it is printed on the printer in the bar and if its meat then it is printed in the kitchen printer.


When we are creating order on the pos , and printing then it is printing correctly to respective printers but when we are creating online order from api and printing it then it is printing The Whole order on both the printers.


We want online orders to print on respective printers based on item label

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·

Understood. I have previously provided you with all of the information you need to solve this problem. You need to use the APIs mentioned here - https://community.clover.com/questions/21552/is-there-any-update-on-getting-labels-connected-to.html.. First you will iterate the line items and obtain the tags per item (InventoryConnector#getTagsForItem). Then you would need to obtain the printers (PrinterConnector#getPrinters) and tags for each printer (InventoryConnector#getTagsForPrinter). Then you will make multiple calls to PrintJob passing the relevant lineitems and printer in each call.

0 Likes 0 ·
mkabhi avatar image
mkabhi answered killerfrost commented

@david thanks for the reply. I see what you mean , but i m curious to know why would print order behave differently for in store orders vs online orders? Isn’t there any flag in print job that would respect item tags

4 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·

An in store order goes through our code and doesn't use StaticOrderPrintJob (which as I said is just a dumb print job). In this case an "online order" is being handled by your App and you are using StaticOrderPrintJob. There are some other APIs you can experiment with like OrderConnector.fire that may meet your needs but I don't have experience with them and you would have to experiment.

0 Likes 0 ·
mKonnekt avatar image mKonnekt David Marginian ♦♦ commented ·

so if i understand it correctly -


REST Printer call prints the order to the default printer - we tested this using the above references you gave us. (Would it be possible to use REST calls to print based on label assignments?)

To print based on labels, use native app. The process is stated below

1) Identify which labels these items belong to

2) Call print function for those labels

3) In case of any items which do not have labels - print them to default printer

Please confirm

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ mKonnekt commented ·
The REST API allows you to specify what printer you would like to print to, I thought it honored labels/tags but I haven't tested that. For a native app your steps are a bit off please see my previous post.
0 Likes 0 ·
Show more comments
adamd avatar image
adamd answered

Not sure if this has been resolved but we have an app in the market called Smart Print which handles label printing amongst other features. Will be happy to lend assistance if needed. :)

1635408780230.png


1635408780230.png (72.7 KiB)
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community