question

Lee Tickett avatar image
Lee Tickett asked Lee Tickett commented

Get Order Item Details

I'm successfully able to loop through order items and get the Name and Code;

int lineItemSize = order.getLineItems().size();
for (int i = 0; i < lineItemSize; i++) {
    Log.d("Price Type: ", order.getLineItems().get(i).getName());
    Log.d("Section: ", order.getLineItems().get(i).getItemCode());
}

But would like to pull additional info like the SKU, modifiers, categories, labels etc. How can I do this? (and also where should I be looking for the documentation on how to do this? What methods/properties are exposed by order/getLineItems() etc?)

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 Lee Tickett commented

The http://clover.github.io/clover-androi... can help you browse the clover-android-sdk. We will be hopefully improving the javadocs there over time as well. You can see there that the com.clover.sdk.v3.order.LineItem object has the methods getItemCode(), getModifications() and getItem() which will give you a reference containing the id you can use to retrieve the com.clover.sdk.v3.inventory.Item from the InventoryConnector. Note that a LineItem may be different from the Item it was created from since the Item can be changed or even deleted any time later. Using the Item you can then get categories, labels, etc.

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.

Lee Tickett avatar image Lee Tickett commented ·

Thanks, thought as much (a bit of a pain, but should be achievable in this instance)

0 Likes 0 ·

Welcome to the
Clover Developer Community