Prestashop Import from Zencart - part 1

April 18, 2009 – 10:15 pm

Tonight, I thought I’d get acquainted with Prestashop. I installed it once before when I was thinking about starting a store for someone. I gave up on that after having to manually create products from static pages. That’s normally something the shop owner would do, but I was trying to create the store in hopes of having the owner pay for it eventually. So, I was going backwards.

For this install, I tried Prestashop with a store that I set up before with Zencart. Zencart works fine, but I guess I wasn’t too interested in the theming part, and I don’t really like the steps to completing a sale. So, the existing store is not very professional looking. It gets the occasional sale, which isn’t stellar, but that’s fine for now since hosting is dirt cheap, and the main avenue of sales is elsewhere. It would, however, be nice to have a better looking site and see if that will increase sales.

So, in comes Prestashop …

Since I’m starting from an existing store, I was pleased to find an OS Commerce to Prestashop import script online. It doesn’t import attributes, but at least it was a start. I don’t know if I should have looked harder for an import script, but oh well …

To import the zencart products (zencart is a modified OSC), I did a mysql dump on the zencart database to a text file. Then, I did a search/replace on the “zen_” to “osc_” which the import script wanted. I also did a “chmod -R 777″ on the os2ps directory to fix some permission problems. Running the script creates 2 sql files in a “generated” directory, one for categories, and another for products.

I ran the category import script without any errors. The product import script had a few problems though due to duplicate keys. I was importing from an older test database, so I don’t know how reliable some of the data is, so this didn’t really bother me. For the item that didn’t import properly, I just edited the sql code to use an id (integer) that wasn’t in use. That fixed the one product, but I had a few more items that also didn’t work. After fixing those, I was able to run the script without errors. Not bad.

When I finally went to the admin site, I could see that there were new categories, but they all had empty names. The sql for the categories had the names in them, so I was a bit confused why they didn’t show up. No big deal … it was easy to edit the missing names. I had to enter short names for the categories anyways, so it wasn’t very much extra work.

The categories showed up with a list of products, and these too had empty names. That again was puzzling since the prices were there. I eventually figured out that the items all were imported with the “id_lang” field set to 2, which is “French”. Since I was viewing the site in English, the site didn’t have the language information for the data in English. So, I ran a simple query to update the “id_lang” to 1 for all the products in the “ps_product_lang” table. Heh, I realized even later that I should have done that to the categories in the “ps_category_lang” table. Now my “ps_category_lang” table has French and English versions of the categories, but I will delete the French ones since they aren’t necessary.

Well, that’s as far as I’ve gotten for now. I have all the products in the database with categories and prices. The next step is to deal with the missing attribute and image data. That will likely be manual.

  1. One Response to “Prestashop Import from Zencart - part 1”

  2. Use Zencart Manager to export all product data in to a csv file, tidy it up in excel and use prestashop’s inbuilt import feature. Also ASAP Utilities for excel can be useful for editing the csv prior to import, ie multiple images.

    By shoulders on Dec 10, 2009

Post a Comment