Description

Add the code to be able to create and edit product attributes through the products data store.

For now, this should be marked as experimental/internal as we iterate on the API so that it is clear that this is incomplete and subject to change.

Properties | Parameter | Type | Description | --------- | -------- | -------- | | id | integer | Unique identifier for the resource. | | name | string | Attribute name. | | slug | string | An alphanumeric identifier for the resource unique to its type. | | type | string | Type of attribute. By default only select is supported. | | order_by | string | Default sort order. Options: menu_order, name, name_num and id. Default is menu_order. | | has_archives | boolean | Enable/Disable attribute archives. Default is false. |

Create

HTTP Request

POST /wp-json/wc/v3/products/attributes

Reference

https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-product-attribute

Edit

HTTP Request

PUT /wp-json/wc/v3/products/attributes/<id>

Reference

https://woocommerce.github.io/woocommerce-rest-api-docs/#update-a-product-attribute

Acceptance criteria

  • [ ] Data store updates
  • [ ] Unit tests
  • [ ] Documentation with examples
0
© 2022 pullanswer.com - All rights reserved.