Support

Account

Home Forums ACF PRO Adding fields to WooCommerce Attributes (not attribute terms)

Unread

Adding fields to WooCommerce Attributes (not attribute terms)

  • I assume this is possible, but probably with more digging into things than I’ve been able to do…

    WooCommerce has a bunch of taxonomies associated with it. One is Attributes, commonly used for things like “Shirt Color”, and then under that attribute would be terms, like “Red”, “Yellow” and “Blue”. Here’s how these are represented in the backend UI:

    Attribute list/add screen

    Something seems a bit odd with the attributes, they have an edit URL like this that does not reference a post_id or anything, and the numbering starts at 1 and increments with each attribute:

    wp-admin/edit.php?post_type=product&page=product_attributes&edit=1

    The terms are simple, which is why I guess it’s easy to add fields there with the normal taxonomy selections in ACF:

    wp-admin/edit-tags.php?taxonomy=pa_altacom-ceramics&post_type=product (list of terms)

    wp-admin/term.php?taxonomy=pa_altacom-ceramics&tag_ID=2804&post_type=product&wp_http_referer=%2Fwp-admin%2Fedit-tags.php%3Ftaxonomy%3Dpa_altacom-ceramics%26post_type%3Dproduct (editing an individual term)

    And you can see here we use ACF to add a field for an image to each term:

    Our addtion to an Attribute Term

    Hope that all makes sense – we want to add a field not at the “term” level (we’ve already done that), but at the attribute level, which seems to be hard because Woo is doing something unique here…

    Technically we could add the field to the terms, but that would mean setting a few fields on a few thousand terms, which would be kind of laborious.

    Any ideas?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.