Zen Cart custom software development, Zen Cart modules, Zen Cart Expert eCommerce with Zen Cart!

Zen Cart to Salesforce Customer Import



Do you want to build a CSV export for your Zen Cart customer data so you can import it into Salesforce?

Come work with me and I'll help you!    Let's get started!

I created a Zen Cart tool which exports customer data from the Zen Cart database into a CSV for import into Salesforce. It's called Salesforce Export Customers, and it's available from the your Zen Cart Admin Tools menu.

Zen Cart Tools menu showing Salesforce options


The CSV is pulled into Salesforce using the Data Import Wizard, which creates Contact and Account objects.

Here is the mapping I used. The address record selected had its address_book_id field value match the customers_default_address_id field from the customers table. (Table aliases: c = customers; ab = address_book.)

SalesforceZen Cart
Legacy ID (custom field)c.customers_id
First Namec.customers_firstname
Last Namec.customers_lastname
Emailc.email_address
Phonec.telephone
Account Namec.email_address
Account TypeCustomer
Company (custom field)ab.entry_company
Shipping Cityab.entry_city
Shipping Countryzen_get_country_name(ab.entry_country_id)
Shipping State/Provinceab.entry_state
Shipping Streetab.entry_street_address
Shipping Zip/Postal Codeab.entry_postcode
Billing Cityab.entry_city
Billing Countryzen_get_country_name(ab.entry_country_id)
Billing State/Provinceab.entry_state
Billing Streetab.entry_street_address
Billing Zip/Postal Codeab.entry_postcode
Mailing Cityab.entry_city
Mailing Countryzen_get_country_name(ab.entry_country_id)
Mailing State/Provinceab.entry_state
Mailing Streetab.entry_street_address
Mailing Zip/Postal Codeab.entry_postcode
The choice to use the Zen Cart email address instead of the company name as the Salesforce Account name was made because email address is a required field which is validated for uniqueness. Doing it this way, you can easily move from a customer you have created a simple record for in Salesforce (left), perhaps based on a Web to lead form, or manual data entry, to the real customer record after they have created an account on your store (right).

Zen Cart Customers in Salesforce
Before import (just email and name)
Zen Cart Customers in Salesforce
After import (fully populated)


Here's what my Zen Cart customer data looks like in Salesforce Lightning:

Salesforce My Contacts list showing Zen Cart Customer Data

Zen Cart Customers in Salesforce



Salesforce Contact Page showing Zen Cart Customer Data

Zen Cart Customer Detail in Salesforce

Notice that the fields have been re-arranged so that the critical data is together on the left, with the Legacy ID (Zen Cart Customer ID) displayed. I have also created a link to the customer account in the store's backend, which shows at the bottom with anchor text "Store Customer Account".

Export is incremental, so once you have done an initial export, only new or changed records are exported. No CSV is produced if there are no new or changed records.

Incremental Export of Zen Cart Customer Data

Zen Cart Incremental Export to Salesforce

Criteria for inclusion in a subsequent export are as follows:
  • New customer accounts created after the last export was done.
  • Customer changed account data in My Account > Change Account Information.
  • Customer changed their primary address in My Account > Change Entries in my Address Book.
  • Admin changed a customer record using Admin > Customers > Customers.

I am using the Essentials version of Salesforce, so I can't do things like create Quotes. But for fun, I wanted to take the next step of importing products and prices from my cart to Salesforce. You can follow my journey by reading about importing Zen Cart Products to Salesforce.

If you're a developer, you can access the source for these scripts: just go to Zen Cart to Salesforce on Github. And if you're not, come work with me and I'll do it for you!