Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Add Attribute Terms Image in WooCommerce?

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'
like image 816
Raj Avatar asked Mar 20 '23 05:03

Raj


1 Answers

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 of taxonomy-images.php:

    if ( ! isset( $taxonomy->show_ui ) || empty( $taxonomy->show_ui ) )
        continue

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

like image 116
Dre Avatar answered Apr 02 '23 03:04

Dre