question

nirmal avatar image
nirmal Suspended asked Jeffrey Blattman answered

If quantity of line item is more then it become slow to add line items to order.

I am trying to add line items using orderConnector.addLineItem() method . For eg. If I am adding 100 quantity of that line item i need to iterate 100 times and add it in order. So it become too slow to add all line items . I wonder if there is any other options available to perform same, because clover own register is capable to add 100 items in no time.

mOrderConnector.addFixedPriceLineItem(mOrder.getId(), mItem.getId(), null, null)
LineItems
10 |2000

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

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered

We don't recommend creating orders with large numbers of items. The Register app, and others, are known not to handle it well. To create multiple line items at a time, you can look into createLineItemsFrom(). This is slightly more optimized, but it's still going to be slow.

10 |2000

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