Created
November 17, 2015 07:34
-
-
Save vishalbasnet23/2ee6715a20c59e1c4b74 to your computer and use it in GitHub Desktop.
Overriding WooCommerce single-product-reviews.php from Plugin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function override_template( $template ) { | |
global $woocommerce; | |
if ( get_post_type() == 'product' && file_exists( untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/woocommerce/single-product-reviews.php' ) ) { | |
return $this->cpm_woopr_plugin_path() . '/woocommerce/single-product-reviews.php'; | |
} | |
return $woocommerce->comments_template_loader($template); | |
} | |
add_filter( 'comments_template', 'override_template', 100, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment