Woocomerce Redirect

Hello,

I need to add a custom redirect page to woocommerce when the user logs out. Normally this would be done through the my-account.php file however X pro is coded to overwrite the default template files of woocommerce due to having a woocommerce.php file under the theme directory. My question is, is it possible to actually edit woocommerce code within the theme? If possible under which directory can i locate the code responsible for such, so i can add in a few lines?

Thanks.

Hi Dennis,

Thanks for writing in!

Please be advised that we do not have my-account.php WooCommerce template override in the theme. You can check that out in pro/woocommerce/ folder. You cannot find any my-account.php file in there. If you want to modify the template file, simply install a child theme and in your child theme’s folder, create woocommerce/myaccount/ folder and insert the my-account.php file with your customizations in it.

For more details, please check this documentation:

By the way, you can also make use of 3rd party plugin to help you redirect users after logging out from your site. You can check this out:

This is exactly the reply i was looking for. I have already begun digging around with the template structure of woocomerce, I was just unsure of how the structure of X worked with it as there seems to be a lot of redirecting between x stacks. I will try the approach above and see how it goes.

As for plugins, yes I could go that route i was just unsure if there would be conflicts due to the way X was structured. Also i planned to do some additional woocommerce customization in the future, so i might as well figure it out now :grin:

Thanks again ill let you know how it goes.

Ended up going with the plugin approach for now, since i wasn’t having to much luck with finding the correct filters needed for redirects.

Seems to work well, hopefully when i dive into it more later all is well :sweat_smile:

Thanks for the help!

Hey Dennis,

You’re welcome!
We’re glad we were able to help you out.

Cheers.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.