Where do I remove admin order fields (unset doesn’t work)

Maybe try this: function custom_admin_billing_fields( &$billing_fields ) { unset($billing_fields[‘state’]); } It’s not clear if when the custom_admin_billing_fields function is called if its return is actually captured and used. So it’s possible that the return is ignored. The ampersand (&) in the parameter definition makes that variable “by reference” instead of “by value”. This way any … Read more

How to get the checkout form data from checkout page when place-order button is clicked

The place-order form button is actually called woocommerce_checkout_place_order, and the code in WC_Form_Handler passes this on to WC_Checkout process_checkout(). Here’s the relevant code. You probably want to hook: woocommerce_before_checkout_process or woocommerce_checkout_process, which happen before this code reads the items from posted data itself (although you could call WC()->checkout()->get_posted_data() yourself I think) woocommerce_after_checkout_validation, which is passed … Read more

Don’t update modified post date when user add a product review or comment?

WooCommerce seems to update the ‘last modified’ value of a product on every change. If you want to take a look at the source code, go to woocommerce\includes\data-stores\class-wc-product-data-store-cpt.php and check the function update. This solution seems to work, however it could be improved to make sure it doesn’t mess up with anything else. Basically checks … Read more

woocommerce add button underneath order details

You can write the below code to your active theme’s functions.php to achieve this: // define the woocommerce_before_checkout_billing_form callback function action_woocommerce_before_checkout_billing_form( $wccs_custom_checkout_field_pro ) { // Write your button code or any html here…. }; // add the action add_action( ‘woocommerce_before_checkout_billing_form’, ‘action_woocommerce_before_checkout_billing_form’, 10, 1 );