In WooCommerce, I have created an attribute “Brand”, and added some terms, like “Brand One”, “Brand Two” etc..
I want to add an image for each term.
Right now there is no option to add image in attribute terms.
Please tell me how to add image in attribute terms.
An admin link is like this:
.../wp-admin/edit-tags.php?taxonomy=pa_brand&post_type=product'
WooCommerce stores product attributes outside of the usual taxonomy table, so you’ll need to go with something more WC-specific. Try the Variation Swatches and Photos extension.
UPDATE: You can use the Taxonomy Images plugin but you have to make a minor alteration. By default the plugin only displays taxonomies that are set to display in the admin area (i.e. the
show_ui
value is set to true). WooCommerce hides the product attribute taxonomies by default, so the plugin will not display them in the settings screen. You can change this behaviour by commenting out/deleting lines 402-402 oftaxonomy-images.php
:Removing these lines will allow he plugin to display all taxonomies, regardless of whether they are hidden or not.
Props to @helgatheviking for suggesting that plugin in the first place
With the “Variation Swatches” plugin (see the answer by @Dre), everything works smoothly, and getting the image is as easy as this:
The “Taxonomy Images” has not been updated since WP 3.6.1…
Technically a WooCommerce “attribute” is just a WordPress Custom Taxonomy. Therefore I would try something like the Taxonomy Images plugin.
“Variation Swatches and Photos extension” plugin is premium and no body would like to purchase that to serve such a purpose as getting an icon image for a brand.
The “Taxonomy Images” has not been updated since WP 3.6.1…
What I came up with is Category and Taxonomy Image and that does the job.
Here’s how you can get the image URL:
I’ve fixed this issue. Actually i was not passing the right value in taxonomy. I was using variation swatches plugin so was not know which value to pass for taxonomy. below is the working code. I was trying to fetch “brands” attributes list with images.