Redirect woocommerce single-product page

My question conserns the Woocommerce plugin.

As you know we can create a custom single-page.php within our theme provided it is inside woocommerce subfolder.

What I need is the ability to have the single-product.php file inside my plugin.

I have tried a lot of ways and it works for other pages, for example I can redirect single-product/title.php to another page but I have had no luck redirect single-product.php.

I understand I probably can redirect it through httaccess file but what I need is redirecting the file through a plugin.

It seems that woocommerce specifies the template file after template_include hook.

So far I managed to use woocommerce_locate_template filter to redirect to some files but for single-product.php there seems to be a complete different story.

Any idea how I can have my own single-product.php inside my custom plugin?

Read more here:: Redirect woocommerce single-product page

Leave a Reply

Your email address will not be published. Required fields are marked *