admin管理员组文章数量:1389783
I would like to add a field in WooCommerce checkout page. I would like to use below code.
add_filter( 'woocommerce_checkout_fields' , 'my_override_checkout_fields' );
But in which file should I put this code ?
I would like to add a field in WooCommerce checkout page. I would like to use below code.
add_filter( 'woocommerce_checkout_fields' , 'my_override_checkout_fields' );
But in which file should I put this code ?
Share Improve this question asked Apr 2, 2020 at 6:07 FoysalFoysal 4451 gold badge5 silver badges16 bronze badges1 Answer
Reset to default 1The short, common answer is:
Inside functions.php file in your theme.
The more advanced answer is:
Well... In any file that is included and executed.
One way is to create your own plugin and put that line inside it.
Another way is to put it in functions.php file in your theme.
Remember, that you should never modify ready themes, so if you use one, you should create a child theme and put that code inside it.
And of course it doesn’t need to be exactly functions.php - you can create any file (like inc/woo-functions.php), put that code inside it and then include it in your functions.php file.
本文标签: Adding Field in WooCommerce
版权声明:本文标题:Adding Field in WooCommerce 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744608416a2615503.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论