relationship betwwen order and products

amir kian asked on July 1, 2020 13:14

Hi there I need to what is the relationship between order and product to figure out how many product which sold? I've tried to use COM_SKU table but I cannot figure out which product how many has sold?

Recent Answers


Dmitry Bastron answered on July 1, 2020 15:16 (last edited on July 1, 2020 15:16)

Hi Amir,

Orders are stored in COM_Order table. One order can contain multiple order items which are stored in COM_OrderItem table. Each order item has OrderItemSKUID field which is a foreign key to COM_SKU table SKUID field. So you can query something like that:

select *
from COM_Order o
     join COM_OrderItem oi
          on oi.OrderItemOrderID = o.OrderID
     join COM_SKU sku
          on sku.SKUID = oi.OrderItemSKUID

Also what you are trying to do I believe can be done via Store Reporting. Check out the existing reports if they fit you or create your own.

1 votesVote for this answer Mark as a Correct answer

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