Skip to content

Instantly share code, notes, and snippets.

View warnakey's full-sized avatar

warnakey

View GitHub Profile
@warnakey
warnakey / functions.php
Created August 7, 2021 07:38
WooCommerce - Place Orders On Hold if billing and shipping information are different
<?php
/* PLACE ORDERS ON HOLD WHEN BILLING & SHIPPING INFO DO NOT MATCH */
add_action( 'woocommerce_thankyou', 'woocommerce_billing_shipping_address_match', 10, 1);
function woocommerce_billing_shipping_address_match( $order_id ) {
if ( ! $order_id ) {
return;
}
// Get the order id
$order = wc_get_order( $order_id );