Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix collections order in CheckoutLinesInfoByCheckoutTokenLoader (#15076)

SzymJdf3371a6c6aa
diff --git a/saleor/graphql/checkout/dataloaders.py b/saleor/graphql/checkout/dataloaders.py
index 6a5c8460d9..a4800f469e 100644
--- a/saleor/graphql/checkout/dataloaders.py
+++ b/saleor/graphql/checkout/dataloaders.py
@@ -134,7 +134,10 @@ class CheckoutLinesInfoByCheckoutTokenLoader(DataLoader[str, list[CheckoutLineIn
],
product=products_map[line.variant_id],
product_type=product_types_map[line.variant_id],
- collections=collections_map[line.variant_id],
+ collections=sorted(
+ collections_map[line.variant_id],
+ key=lambda collection: collection.slug,
+ ),
discounts=checkout_lines_discounts[line.id],
tax_class=tax_class_map[line.variant_id],
channel=channels[checkout.channel_id],