mbcreation

Add support for WooCommerce Pretty Email in WooCommerce 2.1.

Nov 13th, 2014
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 KB | None | 0 0
  1. // woocommerce/includes/wc-core-functions.php
  2. // Locate wc_get_template function and add this two lines, line 102 like in the exemple above
  3. // // Allow 3rd party plugin filter template file from their plugin
  4. // $located = apply_filters( 'wc_get_template', $located, $template_name, $args, $template_path, $default_path );
  5.  
  6. function wc_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {
  7.     if ( $args && is_array( $args ) ) {
  8.         extract( $args );
  9.     }
  10.  
  11.     $located = wc_locate_template( $template_name, $template_path, $default_path );
  12.  
  13.     if ( ! file_exists( $located ) ) {
  14.         _doing_it_wrong( __FUNCTION__, sprintf( '<code>%s</code> does not exist.', $located ), '2.1' );
  15.         return;
  16.     }
  17.  
  18.     // Allow 3rd party plugin filter template file from their plugin
  19.     $located = apply_filters( 'wc_get_template', $located, $template_name, $args, $template_path, $default_path );
  20.  
  21.     do_action( 'woocommerce_before_template_part', $template_name, $template_path, $located, $args );
  22.  
  23.     include( $located );
  24.  
  25.     do_action( 'woocommerce_after_template_part', $template_name, $template_path, $located, $args );
  26. }
Advertisement
Add Comment
Please, Sign In to add comment