question

op27no2 avatar image
op27no2 asked op27no2 commented

Modifier Multiplicity

For Android in particular, how do we figure out if an item has multiple copies of a modifier. I see that we can detect modifier group, then modifiers with their ids, price, name. I don't see a place to retrieve whether there are multiple copies applied to the item. Thanks.

Modifiers
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

Jacob Abrams avatar image
Jacob Abrams answered op27no2 commented

I'm not sure what you mean by multiple copies of a modifier applied to an item. A modifier group may have multiple modifiers in it. An item may be associated with multiple modifier groups.

Here are some relevant functions that might help you:

com.clover.sdk.v3.inventory.InventoryConnectory#getModifierGroups(): get all the modifier groups

com.clover.sdk.v3.inventory.InventoryConnectory#getModifiers(String modifierId): get the modifiers in a particular modifier group

com.clover.sdk.v3.inventory.InventoryConnectory#getModifierGroupsForItem(String itemId): get all the modifier groups associated with a particular item

For an existing Order you can simply call:

Order order = com.clover.sdk.v3.order.OrderConnector#getOrder(String orderId): get an order with line items and modifiers populated

Then invoke order.getLineItems().get(i).getModifications() in a loop for all the line items to see all the modifications for all the line items.

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.

op27no2 avatar image op27no2 commented ·

Sorry, I meant for a line item, basically. I want to know how many copies of a modifier someone has added to an order.

0 Likes 0 ·
Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

I added some information to the answer about how to get the modifiers from line items in an order.

0 Likes 0 ·
op27no2 avatar image op27no2 commented ·

Thanks so much - I was just looking in the wrong spot.

0 Likes 0 ·
Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

No prob, don't forget to click the check mark next to the answer so we know this ticket is taken care of.

0 Likes 0 ·

Welcome to the
Clover Developer Community