How to Add Custom Column in Sales Order Grid of Magento 2? - Webiators

How to Add Custom Column in Sales Order Grid of Magento 2?

How to, Magento 2 5
Avatar photo

Associate software engineer at Webiators, who analyze users’ needs and then design, test, and develop software to meet those needs.

5 Comments
  1. I have tried this and it is working perfectly for Admin Grid display but unfortunately while we export the result, exported csv file has our newly created field but not the values which we have in the grid. In-short above code is not working for exporting data.
    1. Hi! Thanks for your comment, as in this tutorial we have only discussed for Grid but if you want a custom column in the CSV you can use this solution. https://magento.stackexchange.com/questions/250177/magento-2-add-custom-sale-order-grid-column-and-export-in-csv Thanks,
      Yogesh Khasturi Avatar
  2. Hi, thanks for the tutorial, Would you know why I am getting the below error if I try your code example: Unable to unserialize value. Error: Control character error, possibly incorrectly encoded Thanks, T
  3. This is working can you please tell me how to return HTML element from datasource.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href=""> <abbr> <acronym> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>