Zen Cart custom software development, Zen Cart modules, Zen Cart Expert eCommerce Starts Here!

Zen Cart to Salesforce Prices Import



So now you have your products in Salesforce, you think you're home free, right? Wrong-o! You have to set product prices, which is yet another step!

And guess what - just like products, prices are not on the Data Import Wizard. So how do you import them?

Actually, it's easy: come work with me and I'll help you!    Let's get started!

Once you have imported your products, we have to go to Zen Admin, and export prices. Use Salesforce Export Prices from your Zen Cart Admin Tools menu. It creates a file called prices.csv.

Zen Cart Tools menu showing Salesforce options


As in the case of importing products, to import the prices CSV into Salesforce, I use dataloader.io, which creates Price Book Entry objects. You can read about importing using dataloader.io if you're new to it.

Here's the mapping I used:
SalesforceZen Cart
Price Book ID18 character Salesforce ID of your Standard price book
Price Book Entry IDp.products_model on insert
Product2Idp.products_model on update
List Pricep.products_price
ActiveY
(Note that since this is the Standard Price Book, the Use Standard Price field is omitted and left at the default value of false.)

There are two things to know about the Price Book Entries:
  • We can't automatically map all of our fields. Instead, we have to use the trick that was mentioned on the products page of using the Product Code as the identifier.
  • Price Book Entries cannot be upserted. This is a restriction of Salesforce. So this means you have to Import entries for new products, which do not yet have standard prices, and Update entries for existing products when it's time to update. This makes the process of setting prices a bit more confusing than creating customers and products.

The way most people create a standard price is to press the "Add Standard Price" button on the Related screen for their new product. Salesforce Add Standard Price button


But you wouldn't want to do this for hundreds of products. Fear not! That Software Guy to the rescue! Here's how you can Insert Standard Prices (for product that don't have them) and Update Standard Prices (for products that do).

Dataloader.io Insert for Price Book Entries

First, run the Salesforce Export Prices tool from Zen Cart. Then, you'll want to do an Insert for new products which do not yet have standard prices. Here, you want to look up the Product2Id field from the model number.
In dataloader.io, click New Task, then Import, and select the Price Book Entry Object, then click Next.
Dataloader.io Insert of Zen Cart Price Book Entries with Model Number Match


Dataloader.io Update for Price Book Entries

This is what you want to do for existing products which already have standard prices. Here, you want to look up the Price Book Entry ID field from the model number. Dataloader.io Update of Zen Cart Price Book Entries with Model Number Match


You can update as many times as you want, but when you insert, you will get errors for the products that already exist. This is harmless - it's just a bit shocking at first. Here's the dataloader.io error from doing an insert for one new product with 80 existing products in my prices.csv file.
Dataloader.io Update of Zen Cart Price Book Entries with Model Number Match


Now you can avoid these errors by editing prices.csv and just removing older products which have prices, but it's really not necessary; the message is harmless.

Now when you look at the Related screen for the new product, the "Add Standard Price" button is no longer there, and instead, there is a reference to the Standard Price Book.
Salesforce Add Standard Price button


So to recap:
  • On an insert: look up the Product2Id field
  • On an update: look up the Price Book Entry ID field

For prices, there is no incremental import; the Zen Cart Salesforce Export Prices tool exports all product prices (because it doesn't know whether you're doing an insert on new product prices or an update for existing ones).

Once the price on a product is set, you can see it on the detail tab, as is shown in the image above. Also, as noted in importing products, you can use VisualForce to display the price on the Product Details page.

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!