I have created a custom attribute for products. And I have also created an extra column in sales_order_item. How can I copy the value from this custom attribute to the new column in sales_order_item when an order is placed?
Magento 2 – Copy Value from Custom Attribute to Order Item
custom-attributesmagento2sales-order
Best Answer
You can use plugin to add custom attribute to sales_order_item when order is placed. create a di.xml on under etc/di.xml.
Now add a file Vendorname\Module\Plugin\Model\Quote\Item\ToOrderItem.php