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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 14:56:03  来源:igfitidea点击:

Automatically importing products into Woocommerce

mysqlwordpresswoocommerce

提问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_poststable (or replace wpwith 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_postmetaand connected by the post_idcolumn to the wp_poststable. 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-

    1. Visit Tools -> Import in the WordPress dashboard
    2. Click on the WordPress link in the list of importers
    3. Click "Install Now"
    4. 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

  • 安装插件-

    1. 访问工具 -> 在 WordPress 仪表板中导入
    2. 单击进口商列表中的 WordPress 链接
    3. 点击“立即安装”
    4. 最后点击“激活插件并运行导入程序”
  • 插件的使用-

    第 1 步:转到“工具”->“导入”屏幕

    第 2 步:点击 WordPress。

    第 3 步:从计算机中选择输入文件。

    第四步:点击导入

Video Tutorial- The video tutorial on the following page might also be a good resource for import products -

How to import dummy .xml data in wordpress

视频教程- 下页的视频教程也可能是进口产品的好资源 -

如何在 wordpress 中导入虚拟 .xml 数据