question

khyati11 avatar image
khyati11 asked Jeffrey Blattman commented

Broadcast for decrease product quantity/ remove line item

Is there any intent or broadcast that can be used to find out when decrease quantity button is pressed on the register app?

I just want to know when the new line item is added to Clover register it notifies my app through broadcast action(com.clover.intent.action.LINE_ITEM_ADDED") when I trigger plus icon in a register to increment the quantity of line Item it again triggers the same action which is ok,

So the main point of my question is when user will trigger the subtract icon for decrement of line items quantity it will not notify me, I don't know which action I use or which technique I use to get decremented line item detail.


IntentsBroadcasts
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 Jeffrey Blattman commented

There is not a way to know when a line item has been removed from an order. It does seem like an oversight.

You could consider listening for some other broadcast like ACTION_PAYMENT_PROCESSED to take action on the order. I.e., do you really need to know when anything happens to the order? Or can you just examine the completed order at some later point? As a side issue, having to wake up your app every time a line item changes is not great performance-wise.

Without knowing what is your app / how it works it's hard to suggest anything though.

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.

khyati11 avatar image khyati11 commented ·

Our app's requirement is to calculate discount dynamically as an when any item is added/updated or removed from order.
We really need to know when ever any updates are there in the order. As we are getting "com.clover.intent.action.LINE_ITEM_ADDED" action in the same way do we get any other action for update/removed of the line item.

Any suggestion will be much appreciated.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ khyati11 commented ·

Why does it need to do it after every change. Could it do it at a later point?


This is not a "line item removed" broadcast. You can look into register an OnOrderUpdateListener2 (see SDK docs), and using a foreground service to keep your process running. Android doesn't guarantee it will keep running but it should unless the device is under extreme memory pressure. The irony is that keeping your app in memory raises the chance that will be under extreme memory pressure.

0 Likes 0 ·

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