question

mohit-kanada avatar image
mohit-kanada asked Emmanuel MacCaull commented

Is there any way to get event when any line item is updated / modifier is added to line item using clover android SDK

Is there any way to get event when any line item is updated / modifier is added to line item using clover android SDK

I can get events for other events like order added, line item added using broadcast receiver. I there any broadcast receiver or any other thing in android SDK using which app can notify once any line item is updated OR modifier is added to line item while building order inside clover register app
OrdersClover Android SDKLineItemsBroadcasts
2 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.

mohit-kanada avatar image mohit-kanada commented ·

More details :
Can we receive update/data when Register ‘Done’ button for line item add is actioned ?

that Modifier was added to line item just entered,

Or that Quantity was decreased for line item just entered

0 Likes 0 ·
zgreathouse avatar image zgreathouse mohit-kanada commented ·

The first two can be done with the OrderV3Connector.OnOrderUpdateListener. However, there isn't a listener for the stock of an item being decremented at this time.

Can you explain your use case for listening for the stock decrementing? Perhaps we can work toward an alternative solution.

0 Likes 0 ·

1 Answer

zgreathouse avatar image
zgreathouse Deactivated answered Emmanuel MacCaull commented
Yes, you want to use the OrderV3Connector.OnOrderUpdateListener. Set up the listener in your application as a service. You can listen for what you listed above and in your other post. (LineItem added, Modification applied to a LineItem, LineItem updated, Order deleted...etc)
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.

mohit-kanada avatar image mohit-kanada commented ·

Thanks. Its worked. Now from my requirement just one event is missing here in OnOrderUpdateListner and that is "Line Item Modifier Delete event". Is there any way to get it ?

0 Likes 0 ·
zgreathouse avatar image zgreathouse mohit-kanada commented ·

There is not a method within the OnOrderUpdateListener class which accounts for the event of removing a modification from a lineItem at this time. If you would like I can put in a feature request, however cannot guarantee if or how soon this method would be available.

What is the use case for listening for when a modification is removed? Perhaps we can figure something else out.

0 Likes 0 ·
ramya avatar image ramya mohit-kanada commented ·

Hi Mohit ,

how did you called OrderV3Connector.OnOrderUpdateListener2 in your application. Can you please post code here, we tried it in our application by calling it in service but unable to listen events.

0 Likes 0 ·
Emmanuel MacCaull avatar image Emmanuel MacCaull mohit-kanada commented ·

Even using OrderV3Connector.OnOrderUpdateListener2 there is no "line item modifier deleted" event. However, the onOrderUpdated event is sent when modifiers are deleted. If you keep a previous version of the Order in memory, you can compare the previous and current modifiers to determine if any have been deleted.

0 Likes 0 ·

Welcome to the
Clover Developer Community