Add custom checkout validation (WIP)

This commit is contained in:
dinamiko 2022-03-25 10:14:54 +01:00
parent 2024f2c0ab
commit 5089b6335f

View file

@ -98,6 +98,14 @@ class PayUponInvoice {
}
return $description;
}, 10, 2);
add_action('woocommerce_checkout_order_processed', function($order_id, $posted_data, $order) {
if($order->get_billing_country() !== 'DE') {
wp_send_json_error(array(
'result' => 'failure',
));
}
}, 10, 3);
}
public function add_parameter_block() { ?>