Getting All Customer Collection In Magento Including there billing and Shipping Address.

[php] $collection = Mage::getResourceModel(‘customer/customer_collection’)
->addNameToSelect()
->addAttributeToSelect(’email’)
->addAttributeToSelect(‘created_at’)
->addAttributeToSelect(‘group_id’)
->joinAttribute(‘billing_street’, ‘customer_address/street’, ‘default_billing’, null, ‘left’)
->joinAttribute(‘billing_postcode’, ‘customer_address/postcode’, ‘default_billing’, null, ‘left’)
->joinAttribute(‘billing_city’, ‘customer_address/city’, ‘default_billing’, null, ‘left’)
->joinAttribute(‘billing_telephone’, ‘customer_address/telephone’, ‘default_billing’, null, ‘left’)
->joinAttribute(‘billing_fax’, ‘customer_address/fax’, ‘default_billing’, null, ‘left’)
->joinAttribute(‘billing_region’, ‘customer_address/region’, ‘default_billing’, null, ‘left’)
->joinAttribute(‘billing_country_code’, ‘customer_address/country_id’, ‘default_billing’, null, ‘left’)

->joinAttribute(‘shipping_street’, ‘customer_address/street’, ‘default_shipping’, null, ‘left’)
->joinAttribute(‘shipping_postcode’, ‘customer_address/postcode’, ‘default_shipping’, null, ‘left’)
->joinAttribute(‘shipping_city’, ‘customer_address/city’, ‘default_shipping’, null, ‘left’)
->joinAttribute(‘shipping_telephone’, ‘customer_address/telephone’, ‘default_shipping’, null, ‘left’)
->joinAttribute(‘shipping_fax’, ‘customer_address/fax’, ‘default_shipping’, null, ‘left’)
->joinAttribute(‘shipping_region’, ‘customer_address/region’, ‘default_shipping’, null, ‘left’)
->joinAttribute(‘shipping_country_code’, ‘customer_address/country_id’, ‘default_shipping’, null, ‘left’)
->joinAttribute(‘taxvat’, ‘customer/taxvat’, ‘entity_id’, null, ‘left’);[/php]

Leave a Comment

Your email address will not be published. Required fields are marked *

*