I want to make a PHP file to get Orders and Customers from a Magento 2 based webshop (like exporting). I have a full code for Magento 1, but for M2 I have tried a lot of things.
I also needed this function for Products but now I have this.
If anybody can add a full code for Orders and Customers I would be glad, if I found one I will paste it.
to get customer collection and there data you can use
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerObj = $objectManager->create('Magento\Customer\Model\Customer')->getCollection();
foreach($customerObj as $customerObjdata ){
print_r($customerObjdata ->getData());
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With