mcguffin/woocommerce-payforpayment — pull request #6 by ericnicolaas (2013-11-28 13:31:13+00:00)
Title: Call add_payment_options on woocommerce_init action

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 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.

Cheers,
Eric