You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everybody, I am new on these discussions forums and this is the first time I post something.
I dont know if there is already a discussion channel open for what I am about to ask, but I couldn't find anything.
I am using the WooCommerce 3.0.0, and what I want to do is to create a variation giving it the option. Based on the documentation, I am using the respective functions under "Create a product variation" and "Batch update product variations", the thing is that, yes, the variation is created, and it can be seen from the online web store, BUT, on the woocommerce back end, on the variation tab of the respective product, appears a dropdown to select the variation option. If I make a call to "Retrieve a product variation", I dont get the variation name or the option define for it, so using Python is almost impossible to detect each variation id, which option it correspond to, unless, I use the dropdown (from the variation tab) and manually select its respective option, which is not feasible as the code I am developing will sync products between some systems that we managed.
I try checking the documentation, but i dont see how to define the variation name when creating them or updating them.
Checking the response i get from the variation creation, I see that I get somethig like this: 'attributes': [], 'menu_order': 0, 'meta_data': [], 'name': '', 'parent_id': 5094,
where name is empty, and i think that is the issue of why when i retrieve the variations, name is always empty.
Hope I made myself clear.
This will be a sample code for creating a variation.
data = {
"regular_price": "9.00",
"attributes": [
{
"id": 26, # Id from Attribute.
"option": "11",
}
]
}
wcapi.post("products/5094/variations", data).json()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everybody, I am new on these discussions forums and this is the first time I post something.
I dont know if there is already a discussion channel open for what I am about to ask, but I couldn't find anything.
I am using the WooCommerce 3.0.0, and what I want to do is to create a variation giving it the option. Based on the documentation, I am using the respective functions under "Create a product variation" and "Batch update product variations", the thing is that, yes, the variation is created, and it can be seen from the online web store, BUT, on the woocommerce back end, on the variation tab of the respective product, appears a dropdown to select the variation option. If I make a call to "Retrieve a product variation", I dont get the variation name or the option define for it, so using Python is almost impossible to detect each variation id, which option it correspond to, unless, I use the dropdown (from the variation tab) and manually select its respective option, which is not feasible as the code I am developing will sync products between some systems that we managed.
I try checking the documentation, but i dont see how to define the variation name when creating them or updating them.
Checking the response i get from the variation creation, I see that I get somethig like this:
'attributes': [], 'menu_order': 0, 'meta_data': [], 'name': '', 'parent_id': 5094,
where name is empty, and i think that is the issue of why when i retrieve the variations, name is always empty.
Hope I made myself clear.
This will be a sample code for creating a variation.
Thanks everyone.
Beta Was this translation helpful? Give feedback.
All reactions