Hi,
I am trying to get the shipping details after checkout in observer, i am getting billing details
$billingId = $customerSession->getCustomer()->getDefaultBilling();
$address = $objectManager->create(‘Magento\Customer\Model\Address’)->load($billingId);
but just stuck in shipping details, can any one help me to sort this ?
What does mean “after checkout”?
Actually i have set an observer on checkout_onepage_controller_success_action through which i am saving all the orders information to a temporary table, so i want to get shipping details.
i have tried
$customerSession = $objectManager->create('Magento\Customer\Model\Session');
$shippingAddress = $customerSession->getCustomer()->getShippingAddress();
also tried
$Shipping3 = $this->_checkoutSession->getShippingAddress()->getData();
but both are not working.
I got my solution
$IncrementId = $OrderNumber = $this->_checkoutSession->getLastRealOrder()->getIncrementId();
$order_information = $order->loadByIncrementId($IncrementId);
$shipping_data = $order_information->getShippingAddress()->getData();
and got these fields
Array
(
[entity_id] => 124
[parent_id] => 102
[customer_address_id] =>
[quote_address_id] =>
[region_id] => 12
[customer_id] =>
[fax] =>
[region] => California
[postcode] => 90001
[lastname] => Admin
[street] => #534
new horizon
[city] => Tornado
[email] =>
[telephone] =>
[country_id] => US
[firstname] => Magento
[address_type] => shipping
[prefix] =>
[middlename] =>
[suffix] =>
[company] => Browsewire
[vat_id] =>
[vat_is_valid] =>
[vat_request_id] =>
[vat_request_date] =>
[vat_request_success] =>
)