I want to fetch and show which customer bought which product and from where on front end. The issue is i am unable to fetch the above details through order increment id/order id.
So how can i get customer details on
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
Well i would suggest to use
Automatic Dependency injection but if you are using object manager then you can do it like this
<?php //NOT TESTED THOUGH -------------------- //Get Object Manager Instance $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $order = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($IncrementId); //Use increment id here. $order->getCustomerName(); // Check that class. There are lot of functions for getting customers data. Though first you should check if any API available. Because thats a better solution.