Woocommerce - redirection on payment gateway issue

maybe you can help me. I’m working on a woocommerce shop and i have an issue with a redirection to the payment gateway.
In log i have this error:

mod_fcgid: stderr: PHP Warning:  include(): Failed opening '' for inclusion (include_path='.:/usr/share/php:/usr/share/pear:/var/-----------------/web/hoipolloi/wp-content/plugins/woocommerce_postfinancecw/lib:/var/--------------------/web/hoipolloi/wp-content/plugins/woocommerce_postfinancecw/classes') in /var/----------------/web/hoipolloi/wp-content/themes/theme-hoipolloi/base.php on line 95

and a white area instead of the “injected” payment form at the <?php include roots_template_path(); ?>

if i comment the line

add_filter('template_include', array('Roots_Wrapping', 'wrap'), 99); 

in the wrapper.php , i can see the form but all the theme is messes up.
Can you give me some hints?
Thank you in advance.

There are already quite a few threads on Woocommerce. Have you searched/already tried any of the solutions mentioned?

yup made a search on woocommerce and read all of the results… but none seemed to apply to my case unfirtunately…

If no existing threads here help then check the plugin for any hooks it may make into template_include and contact the plugin developer for support. That looks to be a paid plugin, so it should come with some level of support (and posting its source code here is likely prohibited by its license).

Did you manage to find a solution to this?

I’ve ‘solved’ it using the following (although editing the plugin file is not ideal - I will contact the premium plugin makers. Mine was Barclaycard EPDQ).

in lib/wrapper.php, do a check to see if the page is redirection.php (the file the plugin uses) and if so, don’t filter template_includes:

$pageName = basename($_SERVER['PHP_SELF']);

if($pageName !== 'redirection.php'){
	add_filter('template_include', array('Roots_Wrapping', 'wrap'), 99);

Then I navigated to /theme/barclaycardcw_redirection.php which is where the output of the redirection is called, and edited the theme to basically include everything from my base.php (including all the get_template_part()) which makes it behave like a normal page.

If you have a better solution I’d love to hear it.


Hi Shauny, i have made a dirty change in their code to bypass completely roots template… i wil try yours to see if it works! thx!

In my case, the plugin was choosing either with regular redirection header('Location: '.$url);
or with a create a form, fill it and and on $(document).ready to submit it.

It was always choosing the second option that was failing to open.

I’ve just putted: $headerRedirection=true; in redirect.php in the plugin.
Always redirect with header(‘Location:’.$url); and it WORKS fine now.