【问题标题】:Add attributes (Brands) in Product using woocommerce API使用 woocommerce API 在产品中添加属性(品牌)
【发布时间】:2022-12-17 11:06:55
【问题描述】:

您好,我想在 API 的帮助下上传到产品 - 属性品牌

[{"id":0,"name":"brands","position":1,"visible":true,"variation":true,"options":["Toshiba"]}]

它被错误地放置在产品中。因此,它不会出现在过滤器中。

照片显示如何

我究竟做错了什么?

enter image description here

【问题讨论】:

    标签: woocommerce woocommerce-rest-api


    【解决方案1】:

    像这样做:

    [
        {
            "id":0,
            "name": "Brands",
            "position": 0,
            "visible": true,
            "variation": true,
            "options":["Toshiba"]
        }
    ]
    

    大写 nameBrands

    position0,因为从 0 开始计数。

    id 可能有所不同。要获取 Brands 属性的 ID,请转到:Products > Attributes 然后单击 Brands 下的 Edit。然后,在浏览器的地址栏上,您会看到如下内容:

    https://example.com/wp-admin/edit.php?post_type=product&page=product_attributes&edit=3

    edit= 后面的数字是Brandsid。就我而言,它是3

    我希望这能解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-04
      • 2014-06-20
      • 2019-06-02
      • 2017-06-26
      • 1970-01-01
      • 2022-08-19
      • 1970-01-01
      • 2018-12-14
      相关资源
      最近更新 更多