Have you asked Woo all of this?
Thread Starter
jjbte
(@jjbte)
No, I have not. I felt the overall WordPress community would be more knowledgeable regarding taxonomies and custom fields in general. If I limited my question to WooCommerce, I feared it might be overlooked by the majority of experienced WordPress users. As far as the WooThemes site, they no longer have an active forum community for WooCommerce. I have been searching their Knowledge Base, but I have yet to find anything, although I’m not sure I’m searching for the correct terms.
I have found topics on other sites offering WordPress/WooCommerce tutorials/discussions, but none that quite pertain to what I’m trying to do. Again, I’m not sure I’m searching for the correct terms, but I’m still trying.
I keep thinking that a modified custom field would work. The Key would be Author, Editor, or Artist, as applicable, and the Value field would allow me to pick values from an Author-Artist custom taxonomy. I don’t know if that’s really the best solution, and if so, I have not yet figured out how to make it happen.
I felt the overall WordPress community would be more knowledgeable regarding taxonomies and custom fields in general.
I understand your reasoning for asking here, but since Woo is a
Commercial Product that we do not have access to, and is therefore not supported in this forum, we need to ask you to ask Woo:
https://support.woothemes.com/hc/en-us
http://codex.wordpress.org/Forum_Welcome#Commercial_Products
As for custom fields and taxonomies, please review the Codex:
https://codex.wordpress.org/Custom_Fields
https://codex.wordpress.org/Taxonomies
If, after reviewing all of the above, you still have questions (not related specifically to a Commercial Product), you can respond here, mark this as resolved, then ask a question about specific WordPress functions, etc. and how they are used, then folks should be able to help.
Note: There is likely much more to do with this as you are not just using the theme, you have the cart and whatever plugins are used with that also and all need to be able to work with any changes you make to the theme. I do suggest you work with Woo on this or a Dev. that has much experience with them.
Thread Starter
jjbte
(@jjbte)
Thank you for the links, but I have already been through them. WooCommerce is a free plugin available in the WordPress repository. I’m not asking for help with any of its paid themes/extensions.
In fact, I’m not even asking for help with WooCommerce. I’m asking for help with “tinkering” with WordPress taxonomies and custom fields. This issue is not exclusive to WooCommerce. I could be wanting to do something like this for any post type.
Anyway, I have found a plugin in the repository that may help. I haven’t had a chance to actually try it yet, but based on its description, I think it will allow me to do what I want if I can also create my Author-Artist taxonomy.
I am not going to mark this topic resolved since it is not. If anyone has advice on building a custom taxonomy, I’ll be glad to have it. Meanwhile, I will be using the WordPress Codex and other resources to forge ahead and if I get things to work as planned, I will happily share my solutions here in case they can be of help to someone else.
WooCommerce is a free plugin available in the WordPress repository. I’m not asking for help with any of its paid themes/extensions.
Since your original question involved issue(s) where one would modify a theme (and not a plugin), I asked you to ask your theme vendor (a very common and oft misunderstood issue here).
If you believe however that you need help with the mentioned plugin, the place to seek support is at the plugin support section here:
https://wordpress.org/plugins/woocommerce/faq/
https://wordpress.org/support/plugin/woocommerce
If anyone has advice on building a custom taxonomy
The best we could do here is copy and paste from the pages you have already been linked to. The Codex article is much more detailed and complete. It will take some time to review and understand it, not a short period of time.
Please also note that you can create a new post here and ask again about the issue, but try to word it another way (I have been doing this for a while and hope you do not feel misguided).
Thread Starter
jjbte
(@jjbte)
I appreciate your help/advice, and I mean no disrespect, but at no point did I ask for help in modifying a theme. I specifically stated in my initial post that this issue could apply to any WordPress site. A WooCommerce product is really just a custom post type and I was wanting to know how I could modify the behavior of custom fields and taxonomies, both of which are part of WordPress itself. I now wish I’d never mentioned WooCommerce, but I felt I should use an example of what I was specifically trying to do.
Anyway, after trying various search terms, I was able to find two plugins that can accomplish what I wish. The first is Advanced Custom Fields. It allows for the creation of custom fields that can use taxonomy terms as their values.
The other is CPT-onomies. It allows for the creation of custom post types that can also be used as taxonomies. This has the added benefit of allowing me to write biographies for the authors/artists on my site.
Both plugins allow for restriction to certain post types, so I am able to create my fields and taxonomies and have them show only for products.
I have installed both plugins on a test site and they appear to be working as I intended. I just have to write functions and/or create templates to allow the custom fields to appear for my products, but I know there is plenty of info on this in the WordPress Codex and elsewhere. 🙂
Glad you worked this out. Please feel free to share your results.
Thread Starter
jjbte
(@jjbte)
It will be some time before I have a live site to share, but I’ll share the general instructions for what I’ve done on my test site:
I first set up my custom post type as a taxonomy (Authors/Artists) in CPT-onomies. There are many instructions included each step of the way in the plugin’s UI, and the developer has provided lots of documentation on her website. I chose for the taxonomy to only apply to products. Once that was set up, I added some posts of the new type. NOTE: If you don’t need your taxonomy to include post-type content, you can skip this plugin and just register your own new taxonomy.
Next I created my custom field group in Advanced Custom Fields. I chose for the group to only apply to Products. For my purposes, I added 4 fields to the group–Author, Editor, Illustrator, Artist. I set each field to draw from my custom taxonomy created above and allowed for multiple selections. This plugin also provides plenty of documentation at the developer’s website.
I then went to a product and first added applicable items from my Authors/Artists taxonomy. This is done the same way you would add a category to a post. This is necessary to associate the author/artist with the product. I then selected from the taxonomy items listed under my custom fields (e.g., Author, Editor) as applicable. This makes it possible to list the authors/artists under their proper headings for the product.
The final, and trickiest, step is to set up functions and template modifications in order to display your new fields/taxonomies as you wish. I chose to modify woocommerce/templates/single-product/meta.php. I copied this file to mytheme/woocommerce/single-product/meta.php. WooCommerce provides template override info on its website. I am using the functions provided by the two plugins discussed above to retrieve and display the information I wish in my custom template.
The final result is the display of authors/artists above the SKU and Category info for a product. Each author/artist name links to a page that displays all products associated with that author/artist.
I hope this info is useful to someone. These plugins are both quite powerful and can be used to apply custom fields and taxonomies to any WordPress site and any post type.