I have a custom attribute of a product, that I want to have it's value stored in sales_order_items. I have added an extra column in the table sales_order_items. But How can I store the value of that custom attribute into this extra column in sales_order_items?

1 Answer 1


You need to create custom order attribute for it. And then programmatically assign value for it.

You can follow given thread to create order attribute.

Magento 2 How to create new order attribute programatically

  • I have already created the custom attribute, as well have I also added an extra column in the sales_order_items. I want to know how to copy the data from custom attribute to the sales_order_items. I think the link you attached on shows how to created an extra column in database table, which I have already been able to do. Commented Apr 24, 2017 at 10:43
  • I need the same. please
    – Abid Malik
    Commented Sep 13, 2018 at 13:46

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.