Forums Forums Search & Filter Pro Custom template escapes slashes?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #2173

    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?

    Ross Moderator
    #2175

    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

    Anonymous
    #2178

    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 😉

    Ross Moderator
    #2210

    Great thanks for the update, would be useful to other Woocommerce users too 🙂 Hope to get that problem solved in a forthcoming update.

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)