Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically importing products into Woocommerce

I am trying to find a way to automatically import products into Woocommerce. I was wondering if someone had any experience with this, whether using a CSV or directly writing to the database.

like image 805
Soucrit Avatar asked Sep 21 '12 09:09

Soucrit


People also ask

How do I import WooCommerce products with WP all import?

To import variable products, go to WP All Import › New Import, upload or choose your import file, and then select WooCommerce Products from the dropdown list. Use the drag and drop interface to configure your import template and import the variable WooCommerce products.


1 Answers

  1. The Easy Way:

You can easily import CSV files into WooCommerce using the CSV Import Extension: http://www.woothemes.com/extension/product-csv-import-suite/

Or you can use the more flexible WP All In One Import: http://www.wpallimport.com/woocommerce-product-import/

There is also a free solution via this plugin: https://wordpress.org/plugins/product-import-export-for-woo/

  1. The Hard Way:

Woocommerce Products are regular WordPress posts, with a custom post type of product. This means that each product is stored in the wp_posts table (or replace wp with your table prefix). There are many post_type values here. The ones for WordPress have a post_type="product"

All additional product info is stored in the table wp_postmeta and connected by the post_id column to the wp_posts table. There are many meta key/values used, but the most common ones for WooCommerce are fairly intuitive, such as: _visibiilty, _price, _sku, _stock, _length, _width, _height, etc...

I suggest you manually input several products into the WP Admin and then study the data in the tables to make sure you have all the data you need... then you can write your own custom import suite.

Doing it yourself probably will not work as well as some of the pre-made solutions which provide you with good error checking of the input data, and additional fields and preprocessing functions.

like image 199
ethanpil Avatar answered Oct 24 '22 04:10

ethanpil