17 Jan 2008 @ 2:12 AM 
 

Importing product descriptions into ZenCart using PowerShell, Excel, and phpmyadmin - Part 2

 

If you followed the last post, this one is a continuation.

So, you’ve imported all of your products into the products table with the last script. Next, you need to add the information about the products to products_to_categories, so the categories are properly mapped, and to products_descriptions, so you have a name, etc.

 You’ll need the products_id of the FIRST product you inserted with the last script.

Check out this PowerShell script: PowerShell script to generate ZenCart products descriptions and link categories

Edit that and set $i equal to whatever that first products_id was. Run the script from the directory will all of your image files (assuming you’ve formatted the names), and you’ll end up with a CSV that contains two columns. The first is the almost-nicely-formatted product name, and the second is the corresponding products_id. The problem is, unless you capitalized each word in the name (EPIC FAIL on my part), you’ll have all lower case. Doesn’t look so hot.

I read about this neat feature in Excel tonight.  It’s called PROPER and it will convert the first letter of each word in a cell to upper case. So, open your CSV in Rxcel, create a formula in C1 that looks like this: =PROPER(A1)

Copy that down column C, and suddenly you’ll find yourself with nicely formatted and capitalize product titles. Save that CSV somewhere, and check out the next script.

PowerShell script to generate ZenCart products descriptions SQL statements

This one generates two files, one for the products_description table and one for products_to_categories.  

Import both of those files into PHPMyAdmin, and you’ve just saved yourself about 10 hours of data entry. Check out www.chaoscollectibles.com and see how that hour of scripting saved me all that time :) Work Smart.

 

Responses to this post » (None)

 


Comments are open. Feel free to leave a comment below.


 

Leave A Comment ...

 

 XHTML:
You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
\/ More Options ...
Change Theme...
  • Users » 2
  • Posts/Pages » 25
  • Comments » 78
Change Theme...
  • VoidVoid
  • LifeLife « Default
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LiteLight
  • No Child Pages.