New Shopify Certification now available: Liquid Storefronts for Theme Developers

How do I get the last created lineItem in an order?

coco7cats
Visitor
1 0 0

Does anyone know how to get the last created lineItem in an order or know whether the default sort order rule is IDs ascending in Shopify?

I know how to sort order objects, but lineitems in an order don't don't have query parameters which can sort by created time.

When I get a lineItem by [last 1], it seems I can get the last created one, but I couldn't find any documents which say the default sorting rule is IDs ascending.

I don't want to get all lineitems only to find the newest lineitem...

 

 

Replies 0 (0)