wp-graphql-woocommerce icon indicating copy to clipboard operation
wp-graphql-woocommerce copied to clipboard

Product variation attributes

Open rotexhawk opened this issue 5 years ago • 11 comments

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.

image

image

rotexhawk avatar Aug 23 '19 21:08 rotexhawk

Maybe we can leave the current data as is and have an endpoint to get the list of all product attributes?

rotexhawk avatar Aug 23 '19 21:08 rotexhawk

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 "".

kidunot89 avatar Aug 26 '19 19:08 kidunot89

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.

rotexhawk avatar Aug 27 '19 14:08 rotexhawk

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.

kidunot89 avatar Aug 27 '19 15:08 kidunot89

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 avatar Sep 05 '19 19:09 rotexhawk

@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

kidunot89 avatar Sep 24 '19 20:09 kidunot89

@rotexhawk Is this still an issue? I've long since lost track of reasoning for this issue.

kidunot89 avatar Feb 23 '20 18:02 kidunot89

I think we still need a label field. Right now there is no easy way to dynamically query that data

HiepVu511 avatar May 01 '20 15:05 HiepVu511

Linked with #280

travis-r6s avatar May 22 '20 17:05 travis-r6s

I think we still need to be able to export the custom attributes of product variations. Has anyone solved it?

Jommartinez avatar Aug 10 '21 07:08 Jommartinez

+1 Still need this

eusouoviana avatar Aug 19 '21 15:08 eusouoviana