woo-commerce API按类别过滤产品

时间:2017-08-19 06:22:34

标签: woocommerce woocommerce-rest-api

我正在使用woocommece api进行移动应用开发。我需要按类别过滤产品。

我使用以下查询过滤产品

'products?filter[product_cat]=watches'

但它也会归还所有产品。

我正在使用woocommence版本3.1.2。

查询有什么问题? 如何克服这个问题?

1 个答案:

答案 0 :(得分:0)

由于Woocommerce REST API V3 docummentation,您可以使用以下参数过滤产品:

  

类别-(字符串)-将结果集限制为分配了特定类别ID的产品

它应该看起来像

@Repository
public interface DepartmentDao extends MongoRepository<Department, String> {
    @DeleteQuery
    void deleteByDepartment(String department);
}
相关问题