Add a custom checkbox in WooCommerce checkout which value shows in admin edit order

You can do it in 3 steps: Adding the custom checkbox field below the Payment Methods Saving the custom checkbox field when it’s checked in the order meta Displaying the custom checkbox field when it’s checked on the order edit page Here is that code: // Add custom checkout field: woocommerce_review_order_before_submit add_action( ‘woocommerce_review_order_before_submit’, ‘my_custom_checkout_field’ ); … Read more

Multi checkbox fields in Woocommerce backend

2021 Update 2021 Update – Solved issues with: • in_array() where 2nd argument was a string on start*. • $thepostid as in some cases it was empty. That is possible creating a custom function this way: // New Multi Checkbox field for woocommerce backend function woocommerce_wp_multi_checkbox( $field ) { global $thepostid, $post; if( ! $thepostid … Read more

How should I change the woocommerce_form_field HTML Structure?

To rewrite the output html from the woocommerce_form_field function there are 2 filter hooks available: Filter by type: here we can specify the $args[‘type’] like text, password, datetime, select, radio, etc… /** * Filter by type. */ $field = apply_filters( ‘woocommerce_form_field_’ . $args[‘type’], $field, $key, $args, $value ); General filter on form fields: a general … Read more

Adding custom field to product category

You can add custom fields to WooCommerce product category by using following action : product_cat_add_form_fields product_cat_edit_form_fields edited_product_cat create_product_cat UPDATED on 17-Feb-2017 ###For WP version 4.4 and above. As of WordPress 4.4, update_term_meta() and get_term_meta() functions have been added. This means that now we don’t have to save the data in wp_options table anymore, rather they … Read more