how to get custom field value to save order table in Checkout page in Magento 2

There is already a pretty good tutorial about this, check out: http://oyenetwork.com/articles/magento2-devliery-date-module-creation-from-scratch/.

What he does:

  • Create the field in both quote and sales_order table with InstallData.php
  • Add extension attribute for shipping information
  • Override Magento_Checkout/js/model/shipping-save-processor/default to get the attribute data with jQuery and add it to the shipping information.
  • Add the attribute data the the quote
  • Add the attribute data to the order
  • Fetch the data in the admin panel and show on the order page