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. sunil

    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.

    Like

    Reply
  2. Muhammad

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

    Like

    Reply
  3. Nico Smit

    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

    Reply
  4. Peter

    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

    Reply
  5. ross

    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

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s