Kentico 13 Order Item include SKU

Matthew Butler asked on September 2, 2022 12:11

When using OrderItemInfoProvider, what is the best way to include SKU info on fetch of order items to prevent multiple SQL Queries?

Also what in the ExpandColumns()?

Thanks

Correct Answer

Matthew Butler answered on September 6, 2022 15:40

So the OrderItemInfoProvider statics are obsolete, but looking at code it just uses a join

new QuerySource("COM_OrderItem").Join("COM_SKU", "COM_SKU.SKUID", "COM_OrderItem.OrderItemSKUID")

Thank you

0 votesVote for this answer Unmark Correct answer

Recent Answers


Eugene Paden answered on September 6, 2022 14:55

does this help: http://devnet.kentico.com/docs/13_0/api/html/M_CMS_Ecommerce_OrderItemInfoProvider_GetOrderItems_1.htm

Returned items contain pre-loaded OrderItemSKU SKU data.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.