I’m progressing with my tests…
The import works when using hooks like add_action, but on condition that the files are root files.
For example: single-product.php
But it won’t work if you call a hook of an element that is imported into single-product.php.
Using the action “woocommerce_after_main_content” that is in single-product.php, it works.
Using “woocommerce_after_cart_button” that is not present in single-product.php (but is imported through various hooks), it won’t work.
What should I do to fix this problem?