WooCommerce has different template structure where you need to add the code. This page should give you more idea about it: https://docs.woocommerce.com/document/template-structure/.
If the code is located inside of the product loop, you should be able to use the
the_field() functions in a standard way. But if it’s located outside of the loop, then you need to pass the product ID to the second parameter of the
the_field() functions like this:
Where “99” is the product ID.
For the product category, kindly check our tutorial here: https://www.advancedcustomfields.com/resources/get-values-from-a-taxonomy-term/.
If you don’t know how to get the product ID or which file you should modify, kindly get in touch with WooCommerce support instead.
I hope this makes sense 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2023 Advanced Custom Fields.