How to get checkout page information (firstname, lastname, address etc of customer) ,
I have created one phtml file and the code is below
$address = $objectManager->get('\Magento\Sales\Model\Order');
echo $address->getBillingAddress()."<br/>";
echo $address->getShippingAddress()."<br/>";
I need to get customer information irrespective of his/her login.
how can I achieve it, thanks.
Best Answer
Factory Method :
You need to inject
\Magento\Customer\Model\CustomerFactory
and\Magento\Customer\Model\AddressFactory
in your constructthen add this below code in your function
Object Manager Method :
Using Order ID :
Get order ID :
For better coding standard, Don't use Object Manager Directly.