I have created customer address type custom attribute and it's value store as custom attribute now I want to store this value on quote address column.
I have create observer sales_quote_address_save_before type and then do the coding as per below way.
<?php
namespace Vendor\Extension\Observer;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
class QuoteAddressBeforeSave implements ObserverInterface
{
public function execute(Observer $observer)
{
$dataObject = $observer->getEvent()->getDataObject();
$om = \Magento\Framework\App\ObjectManager::getInstance();
$cusaddress = $om->get('Magento\Customer\Api\AddressRepositoryInterface');
$addressId = 15;
$addressData = $cusaddress->getById($addressId);
$addressidnew = $dataObject->getData('address_id');
}
}
?>
So here, I pass static customer id and get custom attribute value it's working. so now I want to store this custom attribute value on quote address table column.
How to get customer address id dynamic base on selection of address on checkout page and store value on quote address.
sales_quote_address_save_before
using$observer->getEvent()->getData('quote_address')->getData('customer_address_id')