1

I need to export customers into a excel format cvs would be ok.

I tried System > Export/Import > Profiles but this does not work as the documentation explains: http://www.magentocommerce.com/knowledge-base/entry/tutorial-using-magentos-import-export-profiles.

Note: I don't need to import this data back into Magento.

What's the trick?

2 Answers 2

2

Go to Manage Customer >> Customers >> Click on that.

Then it will open a grid for customer

Then search Export to CSV. Select CSV and Press Export Button.

1
1

Here my solution with customer address in a small script

require_once("app/Mage.php");
Mage::app();
Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID);
$collection = Mage::getModel('customer/customer')
    ->getCollection()
    ->addAttributeToSelect('*');

$fp = fopen('file.csv', 'w');
foreach($collection as $customer) {
    $customerAddressId = $customer->getDefaultBilling();
    if ($customerAddressId){
        $address = Mage::getModel('customer/address')->load($customerAddressId);

        $fields = array(
            $customer->getFirstname(),
            $customer->getLastname(),
            $address->getData('street'),
            $address->getData('postcode'),
            $address->getData('city')
        );
        fputcsv($fp, $fields);
        //var_dump($fields); echo "<br>";
    }
}

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.