This client has a “drop-ship” wordpress website where he sells items from two different vendors. Between the two vendors he has about 20,000 products on his site. These two vendors provide daily updates on stock levels, prices, product names and descriptions via .csv or .xml files that can be downloaded on their site daily.
Basically – the client wanted a solution built that would take the two source files and update all of his products on his site.
With the two source files, everything was organized by the “sku”; this is the unique “key” identifier for each product. But with a wordpress Woocommerce site, the unique “key” identifier is the “post-id” from wordpress. The product data on the wordpress site is stored in about 4 different tables including “wp-posts”, “wp-postmeta”, and also the tables that handle the categories (taxonomy).
In any case, we had to take the info from source files organized by Sku, and update all of the information scattered in these wordpress tables organized by “post-id”…
We built a solution in the wp-admin under “Gcommerce” which handled all of this. You could just browse your computer for the .xml or .csv file and load that in. Then all you had to do was run the “Update and Add” and it would go through the “source” file and on every product in there, it would check to see if the product is on the site right now or not:
1. If product was not on site; it would create a new product which meant creating a new post, and also all of the new entries in the other tables it needed for that product to have all of the proper information on it.
2. If the product was currently on the site, then it simply updated all the fields like stock quantity, price, product name and description.