0

we are having a problem with some reportings. The "problem" is, that Magento sometimes stores the configurable product along with the actual variant in sales_order_item.

+--------------+---------+----------------+-------------+
| product_type | sku     | name           | qty_ordered |
+--------------+---------+----------------+-------------+
| configurable | S-12345 | Shampoo        |      1.0000 |
| simple       | S-12345 | Shampoo 150 ml |      1.0000 |
+--------------+---------+----------------+-------------+

There are also cases where onl the simple product is in sales_order_item. Why does Magento handle this on different ways?

2 Answers 2

0

It sounds like you are experiencing some inconsistencies in how Magento handles sales order items for configurable and simple products.

In Magento, a configurable product is a product with multiple options, such as size or color, that can be selected by the customer. A simple product is a product with a single SKU that does not have any options or variations.

When a customer purchases a configurable product, Magento creates a sales order item for both the configurable product and the selected simple product variant. This is because the configurable product itself is not a physical product that can be shipped; it is simply a container for the simple product variants.

However, there may be cases where only the simple product appears in the sales order item. This could happen if the configurable product was out of stock or if there was an issue with the way the product was set up in Magento.

To resolve this issue, you may want to review your Magento configuration and ensure that all products are set up correctly.

Here is more explanation

In Magento, when a customer purchases a configurable product, both the configurable product and the selected simple product variant are added to the sales order item. This is because the configurable product is just a container for the simple product variants, and the selected variant is the actual product that will be shipped to the customer.

there may be cases where only the simple product appears in the sales order item. This could happen if the configurable product is out of stock, or if there is an issue with the way the product was set up in Magento. For example, if the configurable product has not been associated with any simple product variants, or if the product options have not been set up correctly, then only the simple product may appear in the sales order item.

2
  • Is there any documentation or explanation for your "However" paragraph? This is the main problem, that only sometimes the exact same product sometimes comes with configurable product and sometimes dont.
    – Luco
    Mar 6, 2023 at 10:16
  • I edited my Answer, please review again after this line "Here is more explanation"
    – Dotsquares
    Mar 6, 2023 at 10:40
0

Magento creates a row for both the configurable product and the associated simple product in the sales_order_item table when a customer purchases a configurable product because both are necessary to calculate the final price of the item. If a customer purchases a simple product directly, without going through the configurable product options, only the simple product is added to the sales_order_item table, since there is no configurable product involved in the purchase.

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.