Hooks are never triggered | WordPress.org

[ad_1]

I use the latest WordPress 6.4 and WooCommerce 8.3 — both clean install on my localhost.

This is the code:

function zk123_test() { die("im here"); }
add_action('woocommerce_after_checkout_validation', 'zk123_test');

The script is called and the action is added correctly. The action is never triggered, but for example this works:

  add_action('woocommerce_shipping_init', 'zk123_test');

I have the default theme StoreFront.

I’ve spent 3 hours on this and I feel frustrated.

Does anybody know why the action “woocommerce_after_checkout_validation” and many others like “woocommerce_after_shipping_rate” are NOT triggered?

My ideas:

  1. WooCommerce is broken for the latest WordPress and many hooks that are documented are not used anymore?!
  2. Hooks are not triggered, because of some settings, but I have fresh install of latest StoreFront, latest WP and WC, and everything is default?!
  • This topic was modified 6 hours, 45 minutes ago by mzvarik.
  • This topic was modified 6 hours, 43 minutes ago by mzvarik.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer