0

Does anyone know why, sometimes, into the table sales_order_itmes, I see rows that has product_options fields like this:

{
    "info_buyRequest": {
        "uenc": "aHR0cHM6Ly9iZXRhLm5hdmlvbmljcy5jb20vaXRhL3BsYXRpbnVtLXBsdXMtbWVkaXRlcnJhbmVhbi1hbmQtYmxhY2stc2VhLTIuaHRtbA,,",
        "product": "16831",
        "selected_configurable_option": "",
        "related_product": "",
        "qty": "1",
        "super_attribute": {
            "140": "4"
        }
    }
}

and some other times I have this?

{
    "info_buyRequest": {
        "uenc": "aHR0cHM6Ly9iZXRhLm5hdmlvbmljcy5jb20vaXRhL2NoYXJ0cy9wcm9kdWN0L2luZGV4Lw,,",
        "product": "16132",
        "qty": 1
    }
}

Both are related to simple products (product_type column is 'simple')

1 Answer 1

0

In Magento 2, the super_attribute is an array that appears in the info_buyRequest object when a product with configurable options is added to the cart.

The super_attribute array contains the selected options for each configurable attribute of the product, along with their respective values. For example, if a configurable product has attributes for color and size, and a customer selects the color "blue" and the size "medium" when adding the product to their cart, the super_attribute array will contain the following data:

"super_attribute": {
    "color": 4,
    "size": 8
}

In this example, "color" is the attribute code for the color option, and "4" is the option value for "blue". "size" is the attribute code for the size option, and "8" is the option value for "medium".

The super_attribute array is important for determining the specific product variant that the customer has selected, as well as for calculating the product price based on the selected options.

2
  • Thanks for your answer, what I have to check in order to see if for the specific product I have these custom options? Is it something that I can check on the admin panel or on the database? This is strange for me because I think that we don't have any custom options for these products. I would like to check if there is something wrong with our products.
    – Safari
    Mar 2, 2023 at 13:08
  • And also, if it's possible... why in that case (when I see super attribute, selected configurable option, related product...) There aren't the prices info that instead are filled in the other scenarios?
    – Safari
    Mar 2, 2023 at 13:18

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.