Skip to content
Advertisement

Add custom checkout field based on product category in Woocommerce

I need to add custom checkout field based on product category. I found this code which works with products, but it is very time consuming to add Ids from every new product from particular category.

JavaScript

How to modify this code to work with product categories?

Advertisement

Answer

Try the following to handle product categories (handling parent terms too):

JavaScript

Code goes in functions.php file of your active child theme (or active theme). It should works.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement