0

I need to export customer data programatically once in a day. I'm using php script to write the export functionality. I used,

$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$order = $objectManager->create('Magento\Sales\Model\Order')->getCollection();

to get Orders export functionality.

How can I write a script to export customer data?

4
  • Joey, i gotta ask, why do you want to do it programmatically? Magento already gives you the option to export both customer main file and just customer addresses. Just wondering if there's any particular reason as to why you're doing it programmatically
    – John
    Apr 6, 2018 at 8:06
  • yes, it's for usage for external program and I need to only include only requested fields and use xml format as output
    – Joey
    Apr 6, 2018 at 9:46
  • Ah gotcha, fair play, i was maybe thinking you wanted the data and decided to do it programmatically.
    – John
    Apr 6, 2018 at 10:21
  • I'm too lazy for that anyways ;)
    – Joey
    Apr 6, 2018 at 10:35

1 Answer 1

0
$customer = $objectManager->create('Magento\Customer\Model\CustomerFactory')->create()->getCollection();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.