- This topic has 3 replies, 2 voices, and was last updated 11 years, 10 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Custom template escapes slashes?
Tagged: Custom template escapes slashes
I’m trying to use the template override when searching my woocommerce products.
The woocommerce templates are usually stored in ‘theme/woocommerce/archive-product.php’, but when entering ‘woocommerce/archive-product.php’ as custom template in the search form config, the slash is stripped so it becomes ‘woocommercearchive-product.php’.
Moving archive-product.php to the themes root folder seems to work, but then I have 2 template files serving the same prupose… Any other options?
Hey Mike
I didn’t notice this! Unfortunately you’ll have to go with this for now, I’ll try to update the plugin so your slashes don’t get stripped and the correct path is resolved.
Thanks
Thanks for the help!
My fix for the time being is to simply create a new archive-product.php in the theme root with this:
<?php
add_filter('body_class','my_class_names');
function my_class_names($classes) {
// add 'class-name' to the $classes array
$classes[] = 'woocommerce';
// return the $classes array
return $classes;
}
include 'woocommerce/archive-product.php';
?>
i should note that my_class_names() is an unrelated fix 😉
Great thanks for the update, would be useful to other Woocommerce users too 🙂 Hope to get that problem solved in a forthcoming update.
Thanks