I just finished a small job updating a zencart database with products from a whole seller. The client had a script already that was built to manipulate the data directly in the database. I really didn’t want to mess with the database directly and thought it might be better off just using the easy update plugin for zencart.

Well during this process I realized that the products did not match the layout for easy populate. So Then we had to convert the csv file.

Well after converting the script file I tried logging into zen cart and it failed every time even when scraping the security code from the login. So I screwed around with that for a couple of hours just fiddling finger effing my keyboard.

Now I decided to take a look at how easy-populate works, turns out that zen plugins are really easy. The script accepts post data for the upload directly and can run independently from the admin interface.

So I didn’t want to thwart the security setup of zen cart. So I added a extra user with a admin_id of 999.

Then proceeded to mod the login I placed the security code if statement below the username and password checks. Then a custom if statement between the 2. That included the easypopulate.php file then exited right afterwards.

Now when logging in with my custom user with the admin_id of 999 it loaded the easy-populate. So now I was able to use curl to post the login data and the newly convert csv file to easy populate so it can insert and update the products.

It was a task, took 3 days to complete all in all. I’m sure if I was a more skilled developer this would have been done in a day or 2. Not counting all the walks I took to refocus.

I will be posting the code google code shortly after I’m satisfied with it. There are still some debugging features.

Currently it encrypts the config information with aes 256, has a web ui for importing and updating. Yeah, it’s stooopid šŸ˜‰