MySQL 自动将产品导入 Woocommerce
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12527998/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Automatically importing products into Woocommerce
提问by Soucrit
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.
我正在尝试找到一种将产品自动导入 Woocommerce 的方法。我想知道是否有人对此有任何经验,无论是使用 CSV 还是直接写入数据库。
回答by ethanpil
1) The Easy Way:
1)简单的方法:
You can easily import CSV files into WooCommerce using the CSV Import Extension: http://www.woothemes.com/extension/product-csv-import-suite/
您可以使用 CSV 导入扩展轻松将 CSV 文件导入 WooCommerce: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/
或者您可以使用更灵活的 WP All In One Import:http: //www.wpallimport.com/woocommerce-product-import/
There is also a fairly popular free solution via this plugin: http://wordpress.org/extend/plugins/woocommerce-csvimport/
通过这个插件还有一个相当流行的免费解决方案:http: //wordpress.org/extend/plugins/woocommerce-csvimport/
2) The Hard Way:
2)艰难的道路:
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"
Woocommerce 产品是常规的 WordPress 帖子,自定义帖子类型为product
. 这意味着每个产品都存储在wp_posts
表中(或替换wp
为您的表前缀)。这里有很多 post_type 值。WordPress 的有一个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...
所有附加产品信息都存储在表中wp_postmeta
并通过post_id
列连接到wp_posts
表。使用了许多元键/值,但 WooCommerce 最常见的键/值相当直观,例如:_visibiilty、_price、_sku、_stock、_length、_width、_height 等...
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.
我建议您手动将几个产品输入 WP Admin,然后研究表格中的数据以确保您拥有所需的所有数据......然后您可以编写自己的自定义导入套件。
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.
自己做可能不会像一些预制解决方案那样有效,这些解决方案为您提供良好的输入数据错误检查以及附加字段和预处理功能。
回答by mujuonly
If you have CSV full of WooCommerce simple Products , you can import all those along with images from URL in one click with this free plugin
如果您有包含 WooCommerce 简单产品的 CSV 文件,您可以使用此免费插件一键导入所有这些产品以及来自 URL 的图像
回答by Swapnali
The WordPress Importerwill import the following content from a WordPress export file:
在WordPress的进口商将导入从WordPress的导出文件内容如下:
- Posts, pages and other custom post types
- Comments
- Products
- Custom fields and post meta
- Categories, tags and terms from custom taxonomies
- Authors
- 帖子、页面和其他自定义帖子类型
- 注释
- 产品
- 自定义字段和帖子元
- 自定义分类法中的类别、标签和术语
- 作者
You can use WordPress Importerplugin for import products into Woocommerce.
您可以使用WordPress Importer插件将产品导入 Woocommerce。
Installation of the Plugin-
- Visit Tools -> Import in the WordPress dashboard
- Click on the WordPress link in the list of importers
- Click "Install Now"
- Finally click "Activate Plugin & Run Importer"
Usage of the Plugin-
Step 1 :Go to the Tools -> Import screen
Step 2 :Click on WordPress.
Step 3 :Select Input File from a computer.
Step 4:Click on Import
安装插件-
- 访问工具 -> 在 WordPress 仪表板中导入
- 单击进口商列表中的 WordPress 链接
- 点击“立即安装”
- 最后点击“激活插件并运行导入程序”
插件的使用-
第 1 步:转到“工具”->“导入”屏幕
第 2 步:点击 WordPress。
第 3 步:从计算机中选择输入文件。
第四步:点击导入
Video Tutorial- The video tutorial on the following page might also be a good resource for import products -
视频教程- 下页的视频教程也可能是进口产品的好资源 -