How to block checkout process when session origin is unknown?
add_action(‘woocommerce_checkout_create_order’, function($order, $data) { if (!isset($_REQUEST[‘wc_order_attribution_utm_source’])) { wc_add_notice(__(‘Order creation failed: Safetech Security.’, ‘woocommerce’), ‘error’); throw new Exception(‘Order creation halted.’); } }, 10, 2); This works for me Updates the issue is in the Paypal wooocommerce plugin, I had to edit the code and stop auto-update if (!isset($_COOKIE[‘sbjs_first’])) { throw new RuntimeException( __(‘Order creation failed: Origin … Read more