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