Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* Filter the cart template path to use our cart.php template instead of the theme's
*/
function csp_locate_template( $template, $template_name, $template_path ) {
$basename = basename( $template );
if( $basename == 'cart.php' ) {
$template = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'templates/cart.php';
}
return $template;
}
add_filter( 'woocommerce_locate_template', 'csp_locate_template', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment