Skip Navigation

[Resolved] displaying Woocommerce Product Vendor's name via Taxonomy Fields

This support ticket is created 4 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by davelow 4 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1245362
Screenshot 2019-05-18 at 21.45.06.png

Tell us what you are trying to do?
Attempting to display Woocommerce Product Vendor information via Taxonomy Fields

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?
hidden link

#1245462

Attempting to display Woocommerce Product Vendor information via Taxonomy Fields
Hi, can you be more specific about which information you want to display? Is this information stored in custom fields, or is this basic information like the vendor name? Also, where are you trying to place this text, and how is it inserted in the page?

Thanks for more details, this will help me see what is going wrong here.

#1245701
Screenshot 2019-05-20 at 16.10.17.png
taxonomy data.png
usermeta.png

Hi Christian,

Thank you for your time. I wanted to display the vendor's name with a link to the vendor's page.
My page currently has 2 maps, the first one displays user meta (using custom fields) via shortcodes, and the second one displays taxonomy meta via shortcodes. hidden link

the deficiency with using usermeta is I can't dynamically link the name to the vendor's page, hence I am exploring what taxonomy data could achieve. the third image seems to suggest that it could do more.
please let me know your thoughts.

thanks

#1246120

Okay I don't really know much about this Product Vendor feature in WooCommerce extensions. If Product Vendors are a public taxonomy, then you can associate Types custom fields with each taxonomy term. Then in a View of the Product Vendors taxonomy, you can output information about each term and the custom fields associated with each term.

However, if Product Vendors are a custom post type, then you would have to be able to associate the Product Vendors custom post type with a custom taxonomy somehow to use term meta. Only public post types can be associated with custom taxonomies, and I'm not sure if Product Vendors are a public post type. If they are, then it seems like you would just use regular custom fields on the Product Vendors post type instead of needing User fields or term fields. So I'm not really clear on why you're choosing to use termmeta, and what you want to achieve.

Let's review your code samples, starting with the two Types termmeta field shortcodes. Termmeta field shortcodes can be used to display custom field data associated with a specific term in a custom taxonomy. Note the documentation for termmeta shortcode includes term_id with a stipulation:

"id" - output the field for the term with this id.
This can be omitted in 2 cases:
-Inside a taxonomy term archive page, where the global term will be used instead
-A Taxonomy View, where the current term of the loop will be used instead

https://toolset.com/documentation/customizing-sites-using-php/functions/#numeric
Click "+ More" to see examples of usage with termmeta. You can see that a View of this taxonomy, or a WooCommerce Archive, is the best place to use the termmeta field shortcode. Otherwise, you must include the term_id so the shortcode knows which term you want to display information about. I'm not clear what location on your site you want to display this information, but unless it is a View of the custom taxonomy or a WordPress Archive of the custom taxonomy, the types termmeta shortcode won't work as expected. It's out of context.

Next let's review the wpv-post-taxonomy shortcode. This shortcode can be placed in a post or in a View of posts to display a list of all the associated terms from the wcpv_product_vendors taxonomy, assuming that is accurate. It can be a simple list of terms, or it can include links to each term's archive, you can access the term archive's URL, or you can display the term slug or name or description or post count. Those are the options you can see in Screenshot 2019-05-20 at 16.10.17.png. Note that this shortcode does not give you the ability to display custom field information from each term. To do that, you must create a View of the taxonomy. You can use a Query Filter to display only the terms associated with the current post, or the current post in a View of posts. In the Loop of the View, insert your termmeta shortcodes to display information from each custom field associated with each term.

#1250253

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.