【发布时间】:2018-04-10 21:43:45
【问题描述】:
使用当前的 Woocommerce 文档,我能够从网站上的 woocommerce 检索所有订单。
"line_items" => array:2 [▼
0 => array:14 [▼
"id" => 1
"name" => "Multi Tool"
"product_id" => 227
"variation_id" => 0
"quantity" => 1
"tax_class" => ""
"subtotal" => "15.00"
"subtotal_tax" => "0.00"
"total" => "15.00"
"total_tax" => "0.00"
"taxes" => []
"meta_data" => []
"sku" => ""
"price" => 15
]
1 => array:14 [▶]
问题是,api 没有为每个产品提供类别,它只响应 line_items 下的 product_id。有没有我可以在每个产品下添加一个名为类别的自定义字段,其中包含每个产品的类别名称?
【问题讨论】:
标签: wordpress woocommerce woocommerce-rest-api