I struggled with this for a while. Give this a try. It’s working on my free theme
add_filter( 'woocommerce_checkout_fields' , 'your_override_checkout_fields' );
function your_override_checkout_fields( $fields ) {
$fields['order']['order_comments']['required'] = true;
return $fields;
}
Related Posts:
- How do I make an HTML table from a database table?
- How to get the custom header image’s alt text?
- Modify previous and next text from pagination links
- Correct regex for wp_embed_register_handler
- WordPress custom taxonomy description for each post?
- Calling a method from functions.php on a click of a button
- Conditional statement for parent, child and grandchild pages
- Two posts in same div – WP loop
- How to add a post or page tag to the list of classes appearing in the body tag’s class attribute?
- WordPress Wysiwyg Content not being displayed
- HTML table from shortcode with multiple parameters
- To echo or not to echo?
- How do I add HTML to a PHP function [closed]
- Correct syntax to html php conversion
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- WordPress automatically adding html tag around PHP code
- Missing sidebar parameter “fix” – before_content
- How Display Posts on category
- ACF page while loop breaks footer while loop
- Getting a specific post values to another div or modal
- Converting HTML Template to WordPress Theme
- search and replace preword from author
- Embed html in php code
- WP grandchild categories in nested ul li
- Customize position of social icons in upme plugin [closed]
- Settings API callback function inserts html quotes from nowhere
- How create a Shortcode with hover and complex options
- WordPress Multiple Navigation bars
- Position banner to right of logo in header – messed up my header file
- How to separate HTML and WordPress files
- Login to wordpress by clicking a link and specifying usernaname and password in url
- Make PHP work with HTML tags
- Syntax error when I try to insert my loop into an unordered list? [closed]
- How to make modifications only to certain elements of an HTML string on the server-side?
- Function returns text instead of html [closed]
- Printing HTML codes
- How i can get post data from database when i am getting post id from url in wordpress
- How to retrieve the data from the sever and displaying it in a page?
- How to execute html code inside php?
- Add data-id attribute to child page links
- wp_insert_post() with HTML tags using PHP
- Prevent redirect to wp-login.php
- Where can I find the inline-css of my theme header?
- How to add post meta in while loop?
- Adding function to child theme’s function.php
- How to use the checked() function to check for a non-empty var
- Remove   from the_excerpt
- Find out last 7 days of upload images, last week uploaded image from Gallery and display them in different pages
- Custom forms with HTML
- Wrap title and excerpt in a div (latest posts block)
- Displaying images outside the content
- how to changes mobile menu toggle breakpoint in WordPress
- PHP inside echo HTML
- html form: redirect page after form completes submit function and posts data
- WordPress User Meta value variable into Google Gauge Chart
- WordPress Post Block Element not properly parsed with the_content filter
- Add other class content with reference class value
- PHP function for horizontal Woocommerce thumbnails and badges
- What are the advantages/disadvantages of ways to use php template files?
- Configure WordPress to Use Responsive Image Rendering
- HTML comment cause issue in functions.php script root
- Slug duplicates once clicking on link
- couldnt show short code atts in category
- separate list of programs in html/javascript coming from php
- Remove span tags from WooCommerce Downloads page
- Drop down question
- How to enable HTML tags in category description without breaking the category page
- Can’t display anything through homepage text editor
- How to find and delete a menu item in php?
- My single.php page skips the first div tag
- opens like sitename.com/URL
- WordPress Slider is not working
- How to display post meta bellow every posts
- Woocommerce custom attributes list help
- How to override html codes in wordpress?
- Access certain Entry in HTML-Table and pass the entry-data in WP not working [closed]
- Switch position of elements in the footer [closed]
- Create html tree sitemap
- Can’t get_users info by using json_encode
- scroll scrpit to particular button position to next id when click button
- Custom HTML form using PHP – help with ajax/username validation
- Code works on page-example.php by not category-example.php
- Can’t make product images clickable
- I need help implement a Javascript code into the PHP file
- Category – “No content found”
- Add options to WordPress backend
- WordPress HTML Helper
- Automatically create a loop for post ID
- WordPress – Image href for home menu nav not working
- get_post_meta is always empty when I use wp_mail
- Save Option on Database
- Implement “No related posts for this entry” into the loop?
- ACF repeater image in video poster with jquery
- Advanced Custom Fields Show PHP in Text Areas
- Parse error: syntax error, unexpected ‘}’ in
- Sorting Problem
- Add multiple HTML attributes to an Elementor button
- Saving meta box data from selected option’s value in database is not working
- Word press – JSPDF – Sending PDF as attachment from wp_mail – Special characters
- How to create different templates for woocommerce single-product.php?