Woocommerce: Enhance woocommerce_variation_option_name filter with term

Created on 17 Oct 2015  路  3Comments  路  Source: woocommerce/woocommerce

Hi,

I would like to extend the filter woocommerce_variation_option_name in includes/wc-template-functions.php to also contain the term itself not just the term name.

I will create a pull request for this.

Thanks
Sven

Most helpful comment

As an alternative, couldn't it be possible to simply pass in an array in each of these spots, and provide indexes for some data available at the given time the filter is used. It'd put some responsibility on the 3rd party dev to check for the index they need existing first, but it'd enhance the filter at least a little bit and make conditional filtering possible.

Just a thought.

All 3 comments

This filter is used in a lot of places: https://github.com/woothemes/woocommerce/search?utf8=%E2%9C%93&q=woocommerce_variation_option_name

It's not everywhere that you can send the $term object.

Hi,
sorry I didn't see that.
I am looking for a way to extend the information on the variation dropdown on the fronted and I need the information from the term to do so if it is a taxonomy.
Thats why I targeted the includes/wc-template-functions.php file specifically.
Are you open to add a second filter after woocommerce_variation_option_name in that file if it is a taxonomy like woocommerce_variation_option_name_frontend?

As an alternative, couldn't it be possible to simply pass in an array in each of these spots, and provide indexes for some data available at the given time the filter is used. It'd put some responsibility on the 3rd party dev to check for the index they need existing first, but it'd enhance the filter at least a little bit and make conditional filtering possible.

Just a thought.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jameskoster picture jameskoster  路  3Comments

pickplugins picture pickplugins  路  3Comments

joelwills picture joelwills  路  3Comments

ThiagoBarradas picture ThiagoBarradas  路  3Comments

richangel picture richangel  路  3Comments