I think you should jQuery to enable and disable the checkout button. Please try this script.
Put this script in the footer.php
.
jQuery(window).on('load',function(){
setTimeout(function(){
jQuery('#payment #place_order').attr("disabled","disabled");
console.log('Hello');
},1000);
});
jQuery(document).on('change','#privacy_policy_field #privacy_policy',function() {
var ischecked= jQuery(this).is(':checked');
if(!ischecked){
jQuery('#payment #place_order').attr("disabled","disabled");
console.log('unchecked');
}else{
jQuery('#payment #place_order').removeAttr("disabled");
console.log('checked');
}
});
Note: This is tested script for your code.
Related Posts:
- How to get current product category ID in product archive page
- WooCommerce prices location in DB
- WP/WooCommerce REST API cart/checkout/order [closed]
- Fatal Error when installing woocommerce despite upgrading
- Adding an action within a function that is being called by add_filter
- Hide Add to Cart Button
- Pass custom Checkout field value to Stripe gateway in WooCommerce
- How to modify “[Product] has been added to your cart” in WooCommerce?
- woocommerce fail to replace template string in email title [closed]
- Why do Woocommerce templates use hooks rather than get_template_part
- Woocommerce checkout via external page [closed]
- Change font size in products listing pages in woocommerce
- WooCommerce customer account multiple emails
- WooCommerce Product Page css
- Get the name of all the Items of cart in current session
- Change WordPress Site Title and Tagline and WooCommerce settings using ACF [closed]
- Using a filter with multiple parameters and $this
- Image is not displayed in overridden woocommerce email
- remove categories from product
- Woocommerce: custom loop in product tabs breaks reviews tab
- Category Tree In WooCommerce Product API
- Using WooCommerce for payments only?
- Programatically Remove Item from Cart Not Working – Needs Page Refresh
- How to delete 1000s of duplicated images in WordPress?
- Set default value field meta_Value [closed]
- Woocommerce Product Import Automation
- Get posts from subcategory by parent category slug
- how to get jetpack’s infinite scroll to work with woocommerce?
- WooCommerce Cart Link based on Cookie Values
- Check if page is a woocommerce attribute
- Debugging why featured images have stopped showing in WooCommerce on the homepage [closed]
- WooCommerce minimum order amount for specific country excluding local pickup [closed]
- DELETE WooCommerce Order data from database
- How do I update every title of a certain category with a phrase
- Change max number of products on shop pages
- WooCommerce: One term for Many Product Attributes
- woocommerce list product by id
- Woocommerce Login Redirect to old domain
- CF7 Ajax isn’t working when called inside WooCommerce “woocommerce_before_add_to_cart_button” hook [closed]
- How to dequeue script on woocommerce product?
- How to output woocommerce products to a page, style and modify the html structure
- Else: Show Message Outside of Product Loop
- Specifically Link To the “Leave a review” part of product page? [closed]
- Variation Swatches for WooCommerce – too many variations
- How to make an edit to an already published post back to Draft
- Display data when category is empty
- Split in 2 columns add to cart button and variable forms
- Images not uploading on product page of woocommercr
- How to access WC()->cart in CF7 hook wpcf7_special_mail_tags
- How to integrate e-transfers with checkout in WooCommerce
- Manual Admin Orders search for billing_company
- Use woocmmerce function on theme and override them
- Send all emails to Shop Manager along with admin
- Snippet to copy product affiliate link to a custom field
- Woocommerce Checkout Page Total Price Inside Google Pay Script
- How to hide order action button after changing order status to completed
- I need help with storefront theme shop page
- How to get rid of variations with unspecified attributes
- Deregister dequeue JS scripts except on 1 product page
- Woocommerce shop page not showing all products
- Wrong Billing Information in WC_Checkout->get_checkout_fields(‘billing’)?
- How to display two different custom taxonomy terms on a WooCommerce single product page
- Registration roles
- Change password notification email
- How to show price update date in product single page?
- Woocommerce Rest API: woocommerce_product_invalid_image_id
- how can my customers view their purchased products history like an invoice in a specific page on WordPress
- How do I make my products on the homepage responsive?
- How to get users data from wordpress woocomerce database to display
- Simple thing esc_url query
- Woocommerce on Subdirectory
- Change WooCommerce state and city checkout fields to dropdowns related to the chosen country
- How to apply a custom coupon to a WooCommerce Subscription recurring amount?
- How to customize product at cart page
- WooCommerce Storefront site-header padding
- WooCommerce: How can I add a certain product to the cart and redirect to the cart from a non-shop page?
- Make Woocommerce breadcrumbs show up using functions.php file
- Alter the cost of products using phpmyadmin sql query
- How does one allow any customer to process any order in store on woocommerce?
- How to check which shortcode is using my template?
- Update products with curl (bash)
- How to get woocommerce integration instance?
- Create woocommerce order on new user registration
- How to put a date range in a virtual/downloadable product? [closed]
- Woocommerce Child Category Permalink Structure Change
- Allow customer to choose an optional free/paid product to add to their order (and reduce stock reduced & record sale)
- How to restrict type/size of file uploads in any plugin?
- Stop the “upload file size” error from printing [closed]
- Redirect whole website or pages to /wp-admin in wordpress
- Changing sale price programmatically, but it’s not shown on front-end
- How to disable the “Upgrade or Downgrade” button in “My account” of WooCommerce Subscriptions
- WooCommerce – Inconsistent Indexing of Orders
- Storefront Child Theme show product attribute [closed]
- How to remove slug from Product category URL in Woocommerce
- Removing ‘woocommerce-no-js’ class from body
- url rewrite doesn’t load woocommerce product
- Create WordPress account on different domain when WooCommerce order completed
- Creating a woocommerce order when a user creates an account
- I want to update shipping charge $0 for all Woocommeerce Subscription auto-renewal orders
- Conflict between Woocommerce Booking + Woocommerce Product Options [closed]