Title: API Improver for WooCommerce
Author: Mário Valney
Published: <strong>2020 年 12 月 23 日</strong>
Last modified: 2021 年 1 月 7 日

---

搜索插件

![](https://ps.w.org/api-improver-for-woocommerce/assets/banner-772x250.png?rev=
2452010)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/api-improver-for-woocommerce/assets/icon-256x256.png?rev=2452010)

# API Improver for WooCommerce

 作者：[Mário Valney](https://profiles.wordpress.org/mariovalney/)

[下载](https://downloads.wordpress.org/plugin/api-improver-for-woocommerce.zip)

 * [详情](https://cn.wordpress.org/plugins/api-improver-for-woocommerce/#description)
 * [评价](https://cn.wordpress.org/plugins/api-improver-for-woocommerce/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/api-improver-for-woocommerce/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/api-improver-for-woocommerce/#developers)

 [支持](https://wordpress.org/support/plugin/api-improver-for-woocommerce/)

## 描述

Improve your WooCommerce API REST without config.

[WooCommerce](https://wordpress.org/plugins/woocommerce/) is a awesome plugin used
by 5+ million WordPress websites to create e-commerce.

It’s awesome and we love it but sometimes we need more from API REST.

### Endpoints

We support V3.

#### /products

 * Will search for a category/tag by “name” and “slug” (in this order) if “id” is
   not provided (or empty).
 * Will search for attribute ID if it’s not provided (or empty). Check [wc_attribute_taxonomy_id_by_name](https://woocommerce.github.io/code-reference/files/woocommerce-includes-wc-attribute-functions.html#function_wc_attribute_taxonomy_id_by_name)
   for more details.

In both cases, **we will not** create a new product attribute, category or tag. 
You can use the “aifw_api_v1_products_search_for_terms” filter to create it and 
return the “term_id”.
 WooCommerce will keep the attribute for product only if a
taxonomy was not found.

#### How to Use

Easy and quick!

Just activate “API Improver for WooCommerce” and it’s done. No configurations.

#### Translations

You can [translate API Improver for WooCommerce](https://translate.wordpress.org/projects/wp-plugins/api-improver-for-woocommerce)
to your language.

#### Review

We would be grateful for a [review here](https://wordpress.org/support/plugin/api-improver-for-woocommerce/reviews/).

#### Support

 * WooCommerce – 4.8

(API Version 3 supports 3.5.x or later, but we did not test it)

## 屏幕截图

 * [[
 * Request to create a Product with a category without ID.
 * [[
 * Example to update a Product with both categories with and without ID.

## 安装

First

 * Install [WooCommerce](https://wordpress.org/plugins/woocommerce/) and activate
   it.

Next

 * Install “API Improver for WooCommerce” by plugins dashboard.

Or

 * Upload the entire `api-improver-for-woocommerce` folder to the `/wp-content/plugins/`
   directory.

Then

 * Activate the plugin through the ‘Plugins’ menu in WordPress.

## 常见问题

### Does it works for another e-commerce plugin?

Nope. The intention here is to improve WooCommerce API REST.

### I want to add my customization to endpoints

For products, you can use the filter “aifw_api_v3_products_request_for_prepare_object_for_database”
to change the request.

### Is there a way to create categories or attributes?

We will not create new terms but you can use the “aifw_api_v3_products_term_not_found”.
[Example](https://gist.github.com/mariovalney/78090bd7eaa064d6b27e44804fd34008).

### Can I help you?

Yes! Visit [GitHub repository](https://github.com/mariovalney/api-improver-for-woocommerce).

## 评价

此插件暂无评价。

## 贡献者及开发者

「API Improver for WooCommerce」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Mário Valney ](https://profiles.wordpress.org/mariovalney/)

「API Improver for WooCommerce」插件已被翻译至 1 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/api-improver-for-woocommerce/contributors)
为本插件所做的贡献。

[帮助将「API Improver for WooCommerce」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/api-improver-for-woocommerce)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/api-improver-for-woocommerce/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/api-improver-for-woocommerce/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/api-improver-for-woocommerce/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/api-improver-for-woocommerce/)。

## 更新日志

#### 1.1

 * Added the ID key if not provided to allow developers send a pretty payload.

#### 1.0

 * It’s alive!
 * Improved endpoint “/products” to accept category/tag by “name” and “slug” if “
   id” is not provided.
 * Improved endpoint “/products” to search for taxonomies by “name” for attributes
   if “id” is not provided.

## 额外信息

 *  版本 **1.1.0**
 *  最后更新：**5 年前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 4.7 或更高版本 **
 *  已测试的最高版本为 **5.6.17**
 *  PHP 版本 ** 7.0 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/api-improver-for-woocommerce/) 和
   [Portuguese (Brazil)](https://br.wordpress.org/plugins/api-improver-for-woocommerce/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/api-improver-for-woocommerce)
 * 标签
 * [api](https://cn.wordpress.org/plugins/tags/api/)[mariovalney](https://cn.wordpress.org/plugins/tags/mariovalney/)
   [products](https://cn.wordpress.org/plugins/tags/products/)[rest](https://cn.wordpress.org/plugins/tags/rest/)
   [woocommerce](https://cn.wordpress.org/plugins/tags/woocommerce/)
 *  [高级视图](https://cn.wordpress.org/plugins/api-improver-for-woocommerce/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/api-improver-for-woocommerce/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/api-improver-for-woocommerce/reviews/)

## 贡献者

 *   [ Mário Valney ](https://profiles.wordpress.org/mariovalney/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/api-improver-for-woocommerce/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://github.com/mariovalney/api-improver-for-woocommerce)