1

I am working with sales_flat_order_item using direct sql and I can't make sense of why both configurable and simple products are inserted into the sales_flat_order_item table. What is the reason behind this?

It seems like a lot of redundant data to just keep track of whether the product was added via a configurable product page vs a simple product page.

I'm just trying to understand this behaviour in case I'm missing something which could impact the accuracy of my queries.

2 Answers 2

4

mageApprentice,Magento used for business logic.It main for variance feature of configurable.Whenever a configurable product cart it save two row one is configurable product details and another is child simple product .But importance thing is that both case sku of two row is same and it is simple sku. As it save two rows,Then you can easily get:

  1. Simple and configurable data at any times using **product_id**
  2. It help for coupon apply.
  3. Sales Report
  4. Another,when configurable item c in art you can get simple product image

But in visible of order item only show those item whose parent_item_id is null.Thus you can only show configurable product details in order.

Simple product is related to configurable item using item_id

enter image description here

1
2

As long as you don't use extensions like SCP or BCP which change this, adding a configurable product to the cart is not equivalent to adding the simple product directly. It is, from stock management perspective, but the price is based on the configuration of the configurable product. To represent this, the structure is as it is. Also it's easier to generate invoices and reports from the data this way, where the order item should refer to the configurable product.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.