@twowheeler are you using the cart flows plugin?
Can you please provide your full stack trace? This isn’t a common issue so it’s most likely due to your combination of plugins.
By seeing the stack trace it will give more clues.
You can find that in your WooCommerce failure logs.
@twowheeler,
I have seen this infinite loop behavior one other time and it’s because the merchant had hooked in to the WooCommerce template filter and was replacing templates that contained the string checkout/payment-method.php
Our pugin uses the same name for a template so if you’re replacing the WooCommerce checkout/payment-method.php file, make sure you’re checking the default path so only WC’s template is replaced and not our plugin’s.
One of the plugins you’re using could be doing that replacement, so if you don’t suspect you have any custom code I would start by investigating the plugins you have active.
The woocommerce log contains the same text as I posted above, so that isn’t much help. I’m not sure how to get a full stack trace in this situation. But meanwhile I will start deactivating the other plugins one by one to see if it clears up. I’ll let you know the outcome. Thanks.
BTW I grepped for the string ‘checkout/payment-method.php’ in the plugins folder and didn’t get any hits outside of braintree and woocommerce itself. Thanks for the thought.
Ok the conflict is with the OpenTickets plugin, which is unfortunate because the purpose of the site is to sell tickets created by this plugin. I’ve posted in both forums since I don’t know which one is the source of the error. Meanwhile, I can’t upgrade Braintree. Thanks for any help.
@twowheeler,
Thanks for the info. Is the open tickets plug-in hosted on word press.org? If so can you please provide the link and I can do some testing.
It will be relatively easy to determine where the error is occurring once I get my hands on that plugin.
Thanks,
Yes here is the link.
Thanks so much!
@twowheeler,
I found the issue, it’s their plugin’s code. They are replacing any template that contains checkout/payment-method.php
without checking where the template is coming from.
Their plugin should only replace the checkout/payment-method.php
template if the template_path contains woocommerce.
Here is the code in their plugin that’s causing the problem:
public static function wc_locate_template($current, $template_name, $template_path) {
$name = $template_name;
$found = self::locate_woo_template( $name );
return $found ? $found : $current;
}
Suggestion: only replace templates when the template originates from WooCommerce.
public static function wc_locate_template($current, $template_name, $template_path) {
if(strstr($template_path, 'woocommerce')){
$name = $template_name;
$found = self::locate_woo_template( $name );
return $found ? $found : $current;
}
return $current;
}
Whoa that works perfectly! Thank you!
@twowheeler I recommend you show that snippet of code to the ticket plugin devs and ask them to incorporate it in their next release.
We always appreciate a good review 🙂
Kind regards,