Where to put coding a validation script for store? [duplicate]

Normally on WordPress you use Your Theme Functions.php to put that code. But in this case we are talking about a WordPress with WooCommerce (I’d think), so if you add custom code to your theme as I told you normally is the case, it will be gone if you change your theme, for that reason and if you aren’t sure where to place the code, choose one of the following options to add the code to your site.

PHP

Use the Code Snippets plugin or similar.

JavaScript

Use Simple Custom CSS and JS.