wordpress 通过REST API更新Woocommerce价格:如果产品未标记EOL,则更新价格

sdnqo3pr  于 12个月前  发布在  WordPress
关注(0)|答案(1)|浏览(141)

我通过woocommerce REST API更新价格。我发送命令更新所有价格。我的网站有一些停产= EOL产品。我计划添加“EOL”标签到这些产品。我试图使命令“更新所有价格,如果产品没有标记为EOL”
REST API中是否有这样的命令?

wh6knrhe

wh6knrhe1#

GET /wp-json/wc/v3/products

GET /wp-json/wc/v3/products/{product_id}/tags

字符串
PUT /wp-json/wc/v3/products/{product_id}

In the request payload, include the updated price value in the "regular_price" field or "price" field, depending on your WooCommerce setup.

Note: Make sure to include the necessary authentication headers (e.g., "Authorization") in your API requests to authenticate with the WooCommerce API.

相关问题