Storing WooCommerce Terms & Conditions in the Database
WooCommerce provides a nice feature that force your customers to accept your terms and conditions if you define the corresponding page within WooCommerce settings. If your customers don’t check the “terms and conditions”, they can’t proceed the order. This is nice and easy to setup.
Setup the Terms & Conditions Page
Just a quick reminder on how to set this up. First of all, create a new page, call it “Terms” (or what you want!), add your content, then go to WooCommerce > Settings > Checkout in WC 2.1.x or to WooCommerce > Settings > Pages for versions below 2.1. Then choose the page you just created in the corresponding dropdown select and save settings.
And here is what your customers will see on the checkout page:
That’s pretty neat right? But what happens when one your customer has a litigation with you? Can you prove that your customer accepted your terms and conditions? The answer is not that simple. You can still say that it’s impossible to purchase on your site without accepting your terms and conditions, but legally, it is not enough.
The solution, is to add a snippet to your site that will store the “terms and conditions” field value within the database, and in that case you can prove that terms and conditions were accepted, order by order.
Simply add this code to the functions.php file within your theme folder:
This code will store the field value within the database, and will also print this information on the “edit order” page: