Woocommerce-admin: Variations Report: Not all attributes available in advanced filters

Created on 9 Nov 2020  路  8Comments  路  Source: woocommerce/woocommerce-admin

Some attributes are not available when using advanced filters.

I noticed this when using Woo's sample products, but went ahead and created my own variable product from scratch and noticed the same thing.

wc-admin 1.7.0-beta.1
woocommerce Version 4.6.2
Jurassic Ninja site

  1. Create an order using Woo's sample product data variable Hoodie /product/hoodie/?attribute_pa_color=green&attribute_logo=No.
  2. Confirm the Hoodie has variations "Logo" and "Color" in the Edit Product screen.
    Screen Shot 2020-11-09 at 2 41 49 PM
  3. See the data from the purchase available in the Variations Report.
  4. Advanced Filters > Add a filter > Attribute
  5. See the "logo" attribute not available in the dropdown.
    Screen Shot 2020-11-09 at 2 41 36 PM
bug

All 8 comments

Thanks for creating this issue @psealock! It had only been previously captured here: https://github.com/woocommerce/woocommerce-admin/issues/5384#issuecomment-709280308:

Currently, the attribute filter only searches "global" product attributes.

@jeffstieler do you have an ballpark on the level of effort to include non-global attributes? Seems like that could really be a non-performant query.

@jeffstieler do you have an ballpark on the level of effort to include non-global attributes? Seems like that could really be a non-performant query.

I haven't looked into it too deeply, but from what I recall it would require querying/parsing the meta_values for all _product_attributes meta keys - so yeah... the potential for poor performance is quite high.

Thanks for confirming my suspicions a bit. Based upon that, I'm going to clear this issue from the milestone. I suppose one thing we should do is make sure this known issue is part of the Variations Report Doc and also include this as a note to Happiness and maybe call it out in the 4.8 release post too where the new report will likely be called out as a new feature.

@timmyc are we amenable to a new lookup table to support this feature? I'm thinking something akin to the wc_category_lookup table, but for custom/one-off attributes.

Another potential solution might be to allow free text searches in the filter control - it's possible to implement without adding a new table, but the downside to this approach is that we could only search the slug values (not the labels).

I think that sounds like a reasonable solution, but that sounds like a bit of an involved addition - so we should probably try to gauge the level of effort and see if we want to prioritize for a future sprint.

Sorry for the lack of a follow up - I figured out a way to do this without a new table and am forging ahead.

Was this page helpful?
0 / 5 - 0 ratings