Customization wishlist-view.php
-
I have made a customization in wishlist-view.php and would like to have that customized file in my themes folder, so the plugin can be updated automatically. Unfortunately the script below (in functions.php) isn’t working and I am unable to get it right. Would you be so kind pointing me in the right direction? Many thanks!
add_filter( 'wc_get_template', 'nav_override_wcwl_wishlistview_template', 20, 5 );
function nav_override_wcwl_wishlistview_template( $located, $template_name, $args, $template_path, $default_path ) {
if ( strpos( $template_name, 'wishlist-view.php' ) === false ) {
return $located;
}
$theme_file = get_stylesheet_directory() . '/yith-woocommerce-wishlist/templates/wishlist-view.php';
$theme_file = wp_normalize_path( $theme_file );
if ( file_exists( $theme_file ) && is_readable( $theme_file ) ) {
return $theme_file;
}
return $located;
}
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.