I tracked down where the info is passed from php , I started at your file -
Magento_Customer/js/model/address-list
define([
'ko',
'./customer-addresses'
], function (ko, defaultProvider) {
'use strict';
return ko.observableArray(defaultProvider.getAddressItems());
});
the defaultProvider here is /vendor/magento/module-customer/view/frontend/web/js/model/customer-addresses.js it returns the addresses by fetching it from customerData which it gets like this
customerData = window.customerData;
@line 24 . A quick search for "window.customerData" shows it is being assigned from window.checkoutConfig.customerData (vendor/magento/module-checkout/view/frontend/templates/onepage.phtml @line 29)
the window.checkoutConfig is in turn assigned as following
window.checkoutConfig = <?= /* @escapeNotVerified */ $block->getSerializedCheckoutConfig() ?>;
in vendor/magento/module-checkout/view/frontend/templates/onepage.phtml @line 26
so this is the point where the php passes the customerData
and hence address info along with it to knockout , specifically window.customerData
which is accessible to ko.
You can further extend the trace by following vendor/magento/module-checkout/Block/Onepage.php's getSerializedCheckoutConfig() function.
Best Answer
For Frontend:
In layout file checkout_index_index call the template file which has your dropdown html code.it will be displayed on you checkout page.
Code: file name has checkout_index_index.xml
In Template file consists :
file name has charity.phtml
Create column in quote table and sales table using setup scripts using "InstallSchema" it will create column into table.
After that using sales_convert_quote and fieldset.xml it will move to quote value to sales table