Want to overwrite functions written in woocommerce-functions.php file

It is possible to override woocommerce functions, I did this recently and added all of my woocommerce extended functionality to my theme's functions.php file so that the woocommerce plugin files remained untouched and are safe to update.

This page gives an example of how you can remove their action and replace it with your own - http://wordpress.org/support/topic/overriding-woocommerce_process_registration-in-child-theme-functionsphp

This page gives an example of extending upon their functions without removing their function, as well as using child themes - http://uploadwp.com/customizing-the-woocommerce-checkout-page/

Hope this helps :)


WooCommerce provides a templating system. It is possible to override woocommerce functions. great way to customize WooCommerce without modifying core files, is to use hooks -

If you use a hook to add or manipulate code, you can add your custom code to your theme functions.php file.

  • Using action hooks -

To execute your own code, you hook in by using the action hook do_action(‘action_name’);.

See below for a great example on where to place your code:

add_action('action_name', 'your_function_name');

function your_function_name() 
{
// Your code
}
  • Using filter hooks-

Filter hooks are called throughout are code using apply_filter(‘filter_name’, $variable);

To manipulate the passed variable, you can do something like the following:

add_filter('filter_name', 'your_function_name');

function your_function_name( $variable )
 {
// Your code
return $variable;
}

Here you can get WooCommerce Action and Filter Hook - https://docs.woothemes.com/wc-apidocs/hook-docs.html