Export Customers from Magento
This task will export customer information from Magento in XML format. The results can be filtered if required. See below for a sample output file.
Settings
Connection
Required
The Magento connection to use. See the Connecting to Magento v1 article if you require more information on how to create/manage connections.
Export Address Book
Required
Set to true to export the full list of addresses for each customer.
Export All
Required
Set to true to export all customers matching the filter, set to false to only export new/modified customers matching the filter.
Export Detailed
Required
Set to true to export billing and shipping addresses, set to false to only export basic information.
Export From
Required
The rolling date to export new/modified customers from, when Export All is set to true. This will update automatically each time the task runs.
Start Date
Optional
Any customers created before this date will be ignored, even if modified.
Output File
Required
The name of the file to export the customers to.
Filter Property
Optional
The property the filter is to be based upon. The property name should match the API field name, as seen in the output file.
Filter Type
Optional
The following types of filter are available:
- eq - Returns records where the property matches the specified value
- gt - Returns records where the property is greater than the specified value
- lt - Returns records where the property is less than the specified value.
- like - Returns records where the property contains the specified value.
- isnull - Returns records where the property is null.
- notnull - Returns records where the property is not null.
Filter Value
Optional
The value the filter is to be based upon. When using the eq filter type, you can specify multiple values by separating them with commas, or using the 'Use a list' option after clicking the ellipsis (...) button.
Zynk Settings
See Common Task Settings.
Examples
Sample output file:
<?xml version="1.0"?>
<ArrayOfCustomer>
<Customer>
<firstname>Andrew</firstname>
<updated_at>2012-01-13 11:03:34</updated_at>
<group_id>1</group_id>
<suffix />
<customer_id>1</customer_id>
<default_billing>9</default_billing>
<prefix>Mr</prefix>
<store_id>0</store_id>
<lastname>Snape</lastname>
<password_hash>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:XX</password_hash>
<default_shipping>9</default_shipping>
<website_id>1</website_id>
<middlename />
<created_at>2011-10-14 00:00:00</created_at>
<email>[email protected]</email>
<default_billing_address>
<city>Newcastle</city>
<firstname>Andrew</firstname>
<updated_at>2012-01-13 11:03:34</updated_at>
<is_default_shipping>true</is_default_shipping>
<country_id>GB</country_id>
<company>Internetware</company>
<postcode>NE1 4XF</postcode>
<prefix>Mr</prefix>
<region>Tyne and Wear</region>
<lastname>Snape</lastname>
<is_default_billing>true</is_default_billing>
<fax>0845 123 2921</fax>
<street>Newcastle Business Centre
6 Charlotte Square</street>
<middlename />
<telephone>0845 123 2920</telephone>
<created_at>2012-01-13 09:49:18</created_at>
<region_id>0</region_id>
</default_billing_address>
<default_shipping_address>
<city>Newcastle</city>
<firstname>Andrew</firstname>
<updated_at>2012-01-13 11:03:34</updated_at>
<is_default_shipping>true</is_default_shipping>
<country_id>GB</country_id>
<company>Internetware</company>
<postcode>NE1 4XF</postcode>
<prefix>Mr</prefix>
<region>Tyne and Wear</region>
<lastname>Snape</lastname>
<is_default_billing>true</is_default_billing>
<fax>0845 123 2921</fax>
<street>Newcastle Business Centre
6 Charlotte Square</street>
<middlename />
<telephone>0845 123 2920</telephone>
<created_at>2012-01-13 09:49:18</created_at>
<region_id>0</region_id>
</default_shipping_address>
</Customer>
</ArrayOfCustomer>
Sample XSLT file for transforming the Magento XML customers to Zynk XML customers (also available in the Auto Mapper)
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="xml"
omit-xml-declaration="no"
standalone="yes"
indent="yes"/>
<xsl:template match="/">
<Company>
<Customers>
<xsl:for-each select="ArrayOfCustomer/Customer">
<xsl:call-template name="Customer" />
</xsl:for-each>
</Customers>
</Company>
</xsl:template>
<xsl:template name="Customer">
<Customer>
<Id><xsl:value-of select="email"/></Id>
<CompanyName><xsl:value-of select="default_billing_address/company"/></CompanyName>
<CustomerInvoiceAddress>
<Title><xsl:value-of select="default_billing_address/prefix"/></Title>
<Forename><xsl:value-of select="default_billing_address/firstname"/></Forename>
<Middlename><xsl:value-of select="default_billing_address/middlename"/></Middlename>
<Surname><xsl:value-of select="default_billing_address/lastname"/></Surname>
<Company><xsl:value-of select="default_billing_address/company"/></Company>
<Address1><xsl:value-of select="default_billing_address/street"/></Address1>
<Town><xsl:value-of select="default_billing_address/city"/></Town>
<Postcode><xsl:value-of select="default_billing_address/postcode"/></Postcode>
<County><xsl:value-of select="default_billing_address/region"/></County>
<Country><xsl:value-of select="default_billing_address/country_id"/></Country>
<Telephone><xsl:value-of select="default_billing_address/telephone"/></Telephone>
<Fax><xsl:value-of select="default_billing_address/fax"/></Fax>
<Email><xsl:value-of select="email"/></Email>
</CustomerInvoiceAddress>
<CustomerDeliveryAddress>
<Title><xsl:value-of select="default_shipping_address/prefix"/></Title>
<Forename><xsl:value-of select="default_shipping_address/firstname"/></Forename>
<Middlename><xsl:value-of select="default_shipping_address/middlename"/></Middlename>
<Surname><xsl:value-of select="default_shipping_address/lastname"/></Surname>
<Company><xsl:value-of select="default_shipping_address/company"/></Company>
<Address1><xsl:value-of select="default_shipping_address/street"/></Address1>
<Town><xsl:value-of select="default_shipping_address/city"/></Town>
<Postcode><xsl:value-of select="default_shipping_address/postcode"/></Postcode>
<County><xsl:value-of select="default_shipping_address/region"/></County>
<Country><xsl:value-of select="default_shipping_address/country_id"/></Country>
<Telephone><xsl:value-of select="default_shipping_address/telephone"/></Telephone>
<Fax><xsl:value-of select="default_shipping_address/fax"/></Fax>
<Email><xsl:value-of select="email"/></Email>
</CustomerDeliveryAddress>
<TermsAgreed>1</TermsAgreed>
<AccountStatus>1</AccountStatus>
</Customer>
</xsl:template>