{"id":220307,"date":"2025-02-07T12:40:58","date_gmt":"2025-02-07T12:40:58","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/age-validation-per-product-for-woocommerce\/"},"modified":"2025-03-14T22:14:27","modified_gmt":"2025-03-14T22:14:27","slug":"age-validation-per-product-for-woocommerce","status":"publish","type":"plugin","link":"https:\/\/en-ca.wordpress.org\/plugins\/age-validation-per-product-for-woocommerce\/","author":4692961,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.3.1","stable_tag":"1.3.1","tested":"6.7.5","requires":"5.0","requires_php":"7.0","requires_plugins":null,"header_name":"Age Validation Per Product for WooCommerce","header_author":"Angelos Synadakis by Social Mind","header_description":"Validates customer's date of birth at checkout based on per-product age validation settings.","assets_banners_color":"060309","last_updated":"2025-03-14 22:14:27","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/socialmind.gr","header_plugin_uri":"https:\/\/socialmind.gr","header_author_uri":"https:\/\/socialmind.gr","rating":0,"author_block_rating":0,"active_installs":10,"downloads":767,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"asynadak","date":"2025-02-07 12:40:39"},"1.3.1":{"tag":"1.3.1","author":"asynadak","date":"2025-03-14 22:14:27"}},"upgrade_notice":{"1.3":"<ul>\n<li>If you are upgrading from a previous version, ensure to clear cache and confirm that your <code>jquery-ui.css<\/code> file is present in <code>assets\/css\/<\/code> for the new datepicker integration in user profiles.<\/li>\n<\/ul>"},"ratings":[],"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":3236580,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":3236580,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":3236580,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":3236580,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.3.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3236580,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3236580,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3236580,"resolution":"3","location":"assets","locale":""},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3236580,"resolution":"4","location":"assets","locale":""}},"screenshots":{"1":"<strong>Simple Product<\/strong> \u2013 Min\/Max DOB fields in the product\u2019s General tab.","2":"<strong>Variable Product<\/strong> \u2013 Global DOB fields.","3":"<strong>Variable Product<\/strong> \u2013 Per-variation overrides.","4":"<strong>Checkout DOB Field<\/strong> \u2013 Shown only when restricted products are in the cart."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[167283,92632,164770,9246,286],"plugin_category":[45],"plugin_contributors":[84638],"plugin_business_model":[],"class_list":["post-220307","plugin","type-plugin","status-publish","hentry","plugin_tags-age-validation","plugin_tags-date-of-birth","plugin_tags-product-restriction","plugin_tags-user-profile","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-socialmind","plugin_committers-asynadak"],"banners":{"banner":"https:\/\/ps.w.org\/age-validation-per-product-for-woocommerce\/assets\/banner-772x250.jpg?rev=3236580","banner_2x":"https:\/\/ps.w.org\/age-validation-per-product-for-woocommerce\/assets\/banner-1544x500.jpg?rev=3236580","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/age-validation-per-product-for-woocommerce\/assets\/icon-128x128.jpg?rev=3236580","icon_2x":"https:\/\/ps.w.org\/age-validation-per-product-for-woocommerce\/assets\/icon-256x256.jpg?rev=3236580","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/age-validation-per-product-for-woocommerce\/assets\/screenshot-1.png?rev=3236580","caption":"<strong>Simple Product<\/strong> \u2013 Min\/Max DOB fields in the product\u2019s General tab."},{"src":"https:\/\/ps.w.org\/age-validation-per-product-for-woocommerce\/assets\/screenshot-2.png?rev=3236580","caption":"<strong>Variable Product<\/strong> \u2013 Global DOB fields."},{"src":"https:\/\/ps.w.org\/age-validation-per-product-for-woocommerce\/assets\/screenshot-3.png?rev=3236580","caption":"<strong>Variable Product<\/strong> \u2013 Per-variation overrides."},{"src":"https:\/\/ps.w.org\/age-validation-per-product-for-woocommerce\/assets\/screenshot-4.png?rev=3236580","caption":"<strong>Checkout DOB Field<\/strong> \u2013 Shown only when restricted products are in the cart."}],"raw_content":"<!--section=description-->\n<p><strong>WooCommerce Age Validation Per Product<\/strong> gives you fine-grained control over who can purchase restricted items in your WooCommerce store based on date-of-birth (DOB) settings. Shop owners can:\n* Set a minimum or maximum DOB on simple products.\n* Globally define DOB restrictions for variable products, or set them per variation.\n* Prompt users for DOB at checkout only if restricted items are in the cart.\n* Block checkout if the entered DOB does not satisfy the product(s) restrictions.<\/p>\n\n<p><strong>Key Features:<\/strong>\n* Per-product or per-variation DOB range (e.g., only allow customers with birthdates in 01-01-1980 to 31-12-2005).\n* Global fields for variable products that override each variation\u2019s settings.\n* Conditional DOB field at checkout (shown only if restricted items are in the cart).\n* Client-side datepicker in the admin (so store managers can pick min\/max dates) and in the checkout for users.\n* Automatic validation to block purchase if the DOB is outside the allowed range.\n* Optionally show notices on the product page or in the cart for restricted items.<\/p>\n\n<p><strong>Use Cases:<\/strong>\n* Alcohol, tobacco, vaping, or adult content requiring age gating.\n* Specialty products requiring a specific DOB range (e.g., child tickets vs. adult tickets).\n* Special subscription products that require age segmentation (i.e. summer camps for children of different ages).\n* Any scenario needing a user\u2019s date-of-birth for compliance.<\/p>\n\n<h3>Usage<\/h3>\n\n<ol>\n<li>Activate the plugin.  <\/li>\n<li>For <strong>Simple Products<\/strong>:\n\n<ul>\n<li>Go to the \u201cGeneral\u201d tab in \u201cProduct Data,\u201d fill in <strong>DOB Minimum<\/strong> or <strong>DOB Maximum<\/strong> in <code>dd-mm-yyyy<\/code> format.  <\/li>\n<\/ul><\/li>\n<li>For <strong>Variable Products<\/strong>:\n\n<ul>\n<li>In the \u201cGeneral\u201d tab, fill in <strong>Global DOB Minimum<\/strong> or <strong>Global DOB Maximum<\/strong>.  <\/li>\n<li>(Optionally) Edit each variation to set specific DOB fields if the global fields are empty or need overriding.  <\/li>\n<\/ul><\/li>\n<li>Optionally adjust <strong>JavaScript<\/strong> to handle date format or display if your store uses different date formats.  <\/li>\n<\/ol>\n\n<p>If you have any questions, see the \u201cFAQ\u201d section or contact us at https:\/\/socialmind.gr\/contact.<\/p>\n\n<!--section=installation-->\n<ol>\n<li><strong>Upload<\/strong> the entire <code>age-validation-per-product-for-woo<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory, or install via the WordPress Plugin Repository (if applicable).<\/li>\n<li><strong>Activate<\/strong> the plugin from your WordPress \u201cPlugins\u201d page.<\/li>\n<li><strong>Ensure<\/strong> WooCommerce is installed and active.<\/li>\n<li>Place the <strong><code>jquery-ui.css<\/code><\/strong> file in <code>assets\/css\/jquery-ui.css<\/code> within the plugin folder. This is used for the datepicker styling.<\/li>\n<li>Go to any WooCommerce product and configure the DOB fields in the \u201cProduct Data\u201d panel:\n\n<ul>\n<li><strong>Simple products<\/strong>: In the \u201cGeneral\u201d tab, look for \u201cDOB Minimum\u201d and \u201cDOB Maximum.\u201d<\/li>\n<li><strong>Variable products<\/strong>: In the \u201cGeneral\u201d tab, set \u201cGlobal DOB Minimum \/ Maximum.\u201d If you need variation-specific overrides, edit each variation\u2019s own fields.<\/li>\n<\/ul><\/li>\n<li>Optionally, instruct your users (or admin) to set their DOB in the <strong>\u201cMy Account \u2192 Account Details\u201d<\/strong> page or in the WP admin profile if needed.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='1%29%20why%20is%20the%20dob%20field%20not%20appearing%20on%20checkout%3F'><h3>1) Why is the DOB field not appearing on checkout?<\/h3><\/dt>\n<dd><ul>\n<li>If there are no restricted products in the cart, the DOB field will not appear (by design).  <\/li>\n<li>Ensure you have set a min or max date for at least one product or variation.  <\/li>\n<li>Check for theme or plugin conflicts that might remove or rename the <code>billing_date_of_birth<\/code> field.<\/li>\n<\/ul><\/dd>\n<dt id='2%29%20how%20do%20i%20set%20an%20%E2%80%9C18%20years%20old%20minimum%E2%80%9D%20instead%20of%20a%20date%20range%3F'><h3>2) How do I set an \u201c18 years old minimum\u201d instead of a date range?<\/h3><\/dt>\n<dd><ul>\n<li>Currently, the plugin relies on a date range. If you want a simple \u201cminimum age,\u201d set the \u201cMinimum DOB\u201d to a date that corresponds to being 18 (for today\u2019s date). For example, if today is 2024, you can set the min DOB to <code>01-01-2006<\/code> to enforce an 18+ rule (adjust as needed over time). Or modify the code to compute from a numeric \u201cMin Age.\u201d<\/li>\n<\/ul><\/dd>\n<dt id='3%29%20can%20i%20store%20or%20reuse%20the%20user%E2%80%99s%20dob%20for%20future%20orders%3F'><h3>3) Can I store or reuse the user\u2019s DOB for future orders?<\/h3><\/dt>\n<dd><ul>\n<li>By default, the plugin checks DOB every time. If you want to store it in the user profile, you can add custom code to copy <code>_billing_date_of_birth<\/code> to user meta. Make sure to comply with privacy laws.<\/li>\n<\/ul><\/dd>\n<dt id='4%29%20why%20do%20my%20variation%20fields%20always%20appear%20empty%3F'><h3>4) Why do my variation fields always appear empty?<\/h3><\/dt>\n<dd><ul>\n<li>If the \u201cGlobal\u201d fields are set, variation fields are intentionally disabled and do not save their own data. If you want to override that, edit the logic to allow both global and variation-level data.<\/li>\n<\/ul><\/dd>\n<dt id='5%29%20can%20i%20display%20a%20notice%20on%20the%20product%20page%20or%20the%20cart%20if%20the%20item%20is%20restricted%3F'><h3>5) Can I display a notice on the product page or the cart if the item is restricted?<\/h3><\/dt>\n<dd><ul>\n<li>Yes. See the plugin\u2019s helper or your theme\u2019s hooks to display a short message like \u201cThis product is age-restricted\u201d on single product pages and in the cart for any restricted item.<\/li>\n<\/ul><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.3<\/h4>\n\n<ul>\n<li>Added front-end user profile DOB editing in My Account \u2192 Account Details (with datepicker).<\/li>\n<li>Forced checkout DOB to match the user\u2019s profile if logged in, overriding stale session data.<\/li>\n<li>Added datepickers in user profiles (admin) for easy input.<\/li>\n<li>Minor styling improvement (padding) on front-end DOB fields.<\/li>\n<li>Enhanced synchronization for variable products\u2019 fields.<\/li>\n<li>Real-time variation sync if global fields are filled.  <\/li>\n<li>Nonce checks and unslashing data for plugin checker compliance.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Original release with per-product \/ per-variation DOB, notices, and server-side validation.<\/li>\n<\/ul>","raw_excerpt":"Validate and enforce age restrictions per product or variation in WooCommerce, with user profile storage.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/en-ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/220307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/en-ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/en-ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/en-ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=220307"}],"author":[{"embeddable":true,"href":"https:\/\/en-ca.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/asynadak"}],"wp:attachment":[{"href":"https:\/\/en-ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=220307"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/en-ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=220307"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/en-ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=220307"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/en-ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=220307"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/en-ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=220307"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/en-ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=220307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}