Answer the question
In order to leave comments, you need to log in
How to write attributes to JSON when creating variations via Rest API?
The problem is, adding products via the API is configured, and it seemed to work fine, I don’t know for sure, but now the point is that the product is created normally via the API, attributes are also added normally, but I can’t create variations from specific attributes .
{
"type": "variable",
"name": "My product 1",
"description": "My product description 1",
"regular_price": "200",
"short_description": "Мое описание",
"images": [
{
"src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_front.jpg"
}
],
"attributes": [
{
"id": 37,
"name": "Фасовка",
"slug": "pa_фасовка",
"type": "nasa_label",
"visible": true,
"variation": true,
"options": ["Коробка", "Штука"]
}
]
}
{
"regular_price": "150",
"attributes": [
{
"id": 37,
"name": "Фасовка",
"option": "Коробка"
}
]
}
"attributes": [],
"attributes": [
{
"id": 37,
"name": "фасовка",
"option": "%d1%88%d1%82%d1%83%d0%ba%d0%b0"
}
],
Answer the question
In order to leave comments, you need to log in
I figured it out, it was in the name of the label for the attribute, it should be in Latin)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question