Essentially, this happens because you have called the add_payment_options on the before_woocommerce_init action. Our plugin loads the shipping class on woocommerce_init. While cycling through the payment gateways, your plugin eventually calls the COD payment gateway, which tries to instantiate all the registered shipping methods.
I'm looking to see if I can improve this in our plugin, but thought it might be worth changing the point at which you call this function, as I'm guessing you may end up with some other plugin incompatibilities as well.
Hi,
I just set the hook to woocommerce_init. Works still well, so I included it in the 'official' version.
(Testing and verifying took me while – sorry.)
Cheers and Thanks for your suggestions
jörn
A customer using our bundle rate shipping plugin for Woocommerce (http://codecanyon.net/item/woocommerce-ecommerce-bundle-rate-shipping/1429243) encountered a fatal error when they had woocommerce-payforpayment installed. I just took a look through the code and was eventually able to narrow down the cause.
Essentially, this happens because you have called the
add_payment_options
on thebefore_woocommerce_init
action. Our plugin loads the shipping class onwoocommerce_init
. While cycling through the payment gateways, your plugin eventually calls the COD payment gateway, which tries to instantiate all the registered shipping methods.I'm looking to see if I can improve this in our plugin, but thought it might be worth changing the point at which you call this function, as I'm guessing you may end up with some other plugin incompatibilities as well.
Cheers, Eric