Home › Forums › ACF PRO › Integrating with WooCommerce › Reply To: Integrating with WooCommerce
Hi @s7media
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 get_field()
or 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 get_field()
or the_field()
functions like this:
get_field('custom_field_name', 99);
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.