The woocommerce-hooks.php file is where it’s at for WooCommerce Templating

EDIT: This file has been moved to woocommerce/includes/wc-template-hooks.php

Fully customizing WooCommerce did not make sense to me until I finally tracked down this file: /wp-content/plugins/woocommerce/woocommerce-hooks.php.

This file lists all of the hooks and all of the actions that are added to the hooks. So, if you’ve ever tried searching through the rather abstracted template files and not be able to find what you’re looking for to customize, check out the woocommerce-hooks.php file.

I didn’t find any direct mention of this file in the docs, so hopefully the 2.0 WooCommerce docs will have this file at least mentioned as the place to go to see the default loading of actions.

Have to say though, that once found, everything was super clear to figure out, so big thanks to the dev team for clean coding!

10 thoughts on “The woocommerce-hooks.php file is where it’s at for WooCommerce Templating

  1. Looking through that file, customizing woocommerce makes a little more sense. It is clear that the developers are insane.

    Important, commonly used hooks are referenced there, but functions are not defined. Some of them are aliases for other functions that have so little code in them, that they shouldn’t actually be functions.

    It’s a mess.

    Liked by 1 person

  2. Yes – the problem lies in their incomplete documentation about hooks – they should explain everything about the hooks they provide, that’s common sense

    Like

  3. It’s not there…? The file must have been moved in the newer version of woocommerce. I have been looking for this file since I started working with woocommerce, and thought your post would save my life. Any idea where it is now?

    Like

  4. That was a really useful reference file (/plugins/woocommerce/woocommerce-hooks.php.) but it seems to have gone in the latest version. Does anyone know where it has been relocated to? Or have the got rid of it?

    Should be something they have in their docs really

    Like

  5. Worked like a charm!! Thank you!! if you can not find the file please read the edit line at the top of the article.

    Like

Leave a comment