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

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

How to, Magento 2 5 61 Views
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.
    Avatar photo
    Sagar
    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
      Yogesh Khasturi
  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
    Avatar photo
    Tyant
  3. This is working can you please tell me how to return HTML element from datasource.
    Avatar photo
    Pritesh Saxea

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>