最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - Default click "I have read and agree to the website terms and conditions"

programmeradmin2浏览0评论

On WordPress checkout page, I want to make the "I have read and agree to the website terms and conditions" default clicked. Users can unclick the check icon. Is there any code available?

On WordPress checkout page, I want to make the "I have read and agree to the website terms and conditions" default clicked. Users can unclick the check icon. Is there any code available?

Share Improve this question asked Mar 16, 2022 at 8:28 Imtango30Imtango30 425 bronze badges 3
  • There is a template for that you can override, terms.php. Just make sure to not edit the core woocommerece files, you would need to create a override, they explain in the comments – Buttered_Toast Commented Mar 16, 2022 at 8:41
  • Hi @Buttered_Toast, can't it be done via functions? – Imtango30 Commented Mar 16, 2022 at 8:49
  • WordPress doesn't have a checkout. Are you using a plugin? Presumably WooCommerce. Please note that while @Buttered_Toast and Zeshan were kind enough to give you information, third party plugins such as WooCommerce are off topic here. – Jacob Peattie Commented Mar 16, 2022 at 12:23
Add a comment  | 

1 Answer 1

Reset to default 0

Try this snippet in functions.php for your child theme

add_filter( 'woocommerce_terms_is_checked_default', '__return_true' );
发布评论

评论列表(0)

  1. 暂无评论