wp-graphql-woocommerce
wp-graphql-woocommerce copied to clipboard
Product variation attributes
I am seeing two bugs with product attribute variations. The name field returns the wordpress field name. Maybe add Label
Field as well? Also for sizes the value is empty.
With the current design I don't know if it's possible to build the default product page. See screenshot.
Maybe we can leave the current data as is and have an endpoint to get the list of all product attributes?
I don't know if I would call this a bug. pa_color
is the name of the taxonomy, and should probably the name of the attribute instead. The second attribute size
isn't taxonomy based and the reason the value is ""
is because a size
value is assigned for that variation. However, I do think this should be null
instead of ""
.
Sounds good. I agree it's probably not a bug. For the second part, is it better to have a different query that will return a list of attributes with values or bake that into the same product query?
Right now I don't know what values to give to the size or color drop down.
Hmm :thinking: , values for non-taxonomy atttributes are stored as a string value somewhere, in a format like this 'Yes|No|Maybe'
. I'll have dig more into how to expose it to the schema.
Yeah, that might be a bit tricky. Honestly for version one, it will be easier to just return the values as they are entered/stored
.
@rotexhawk I think I stumbled on to the solution for this issue. The attributes and there options are stored on the parent product as well. If you run a cross-examination for any attributes on the variation with ""
for the value, you can use the render a <select />
option or whatever using the data from the corresponding attribute
or the parent Product
@rotexhawk Is this still an issue? I've long since lost track of reasoning for this issue.
I think we still need a label
field. Right now there is no easy way to dynamically query that data
Linked with #280
I think we still need to be able to export the custom attributes of product variations. Has anyone solved it?
+1 Still need this