I am using the YITH Wishlist plugin (YITH WooCommerce Wishlist) and want to modify the default HTML structure. According to the plugin documentation, it should be enough to place the wishlist.php
template file inside the woocommerce
folder of the theme.
However, this template is not loading when using the Sage theme. The plugin uses the following code to determine which template to use:
php
Копировать код
$woocommerce_base = WC()->template_path();
$template_woocommerce_path = $woocommerce_base . $path;
$template_path = '/' . $path;
$plugin_path = YITH_WCWL_DIR . 'templates/' . $path;
$located = locate_template(
array(
$template_woocommerce_path, // Search in <theme>/woocommerce/.
$template_path, // Search in <theme>/.
)
);
if ( ! $located && file_exists( $plugin_path ) ) {
return apply_filters( 'yith_wcwl_locate_template', $plugin_path, $path );
}
The $located
variable is always empty, regardless of whether I place the templates inside the theme folder or the woocommerce
folder.