We already talked about displaying an ACF field on the single product page. This time around, we’ll do the exact same but for the product loop pages (shop, category, tag, etc.). ACF (Advanced Custom Fields) is an awesome plugin to create and manage custom fields, so this is definitely a tutorial that will help many WooCommerce developers.
Please note that if ACF is not active, the snippet will break the site. There is a way to make it trigger only when ACF plugin is active, just so you know. Anyway, let’s see how we can display the value of a product ACF inside the loop. Enjoy!
With the PHP snippet below, it was super easy to display additional information in the shop page, and specifically a product custom field by ACF plugin.
Note: please change the ACF field ID inside the get_field function to your own custom field ID. In my case I’ve used a custom field ID called “warranty“.