Woocommerce checkbox by default in checkout

From experience, I found one flaw in the WooCommerce plugin and decided to fix it. In the standard version of WooCommerce, a checkbox has appeared where you can agree to the rules of the site, but there is no option for admin to make the checkbox selected by default.

It turned out that this functionality, like many things are just hidden in WooCommerce itself, and it is very easy to implement. To do this, you just need to add an additional small filter to the functions.php file. See code below:

Another way to add a checkbox to the rules of the store

So. create (if not) folder woocommerce in the theme folder in it the checkout folder and add the terms.php file there (it can be taken from the plugin folder of the same name )
now open the file and add checked=”checked” after name=”terms”.

Save and close, all, now on the checkout page there is a daw next to "I accept the terms ..." will stop automatically.


Купить хостинг WordPress
WordPress tutor
Online tutoring services. List of courses I teach
  • Basic web design course;
  • Site layout;
  • General course on CMS WordPress and continuation of the course on template development;
  • Website development in PHP.
Read more on the page WordPress tutor
*/

Nikolaenko Maxim

Director of web studies ProGrafika. I am developing, website design and promotion. Always glad to new blog readers and good clients.


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Templates for WordPress
The best hosting in Ukraine
Stable hosting for Drupal