Support » Plugin: WooCommerce » payment gateway Class not found

  • Hi,

    I’ve followed the instructions available here in order to upgrade my custom payment gateway:

    My plugin works perfectly on WC versions before 2.0.

    Following the instructions have fixed a few issues. However, I still get this error when I try to access WC payment settings after having installed the custom plugin:

    Fatal error: Class ‘woocommerce_myplugin’ not found in /…/woocommerce/classes/class-wc-payment-gateways.php on line 45

    I’ve changed hook registrations this way
    add_action( ‘woocommerce_api_’ . strtolower( get_class( $this ) ), array( $this, ‘myplugin_function’ ) );

    And finally, here is the beginning of my main plugin file:

    add_action('plugins_loaded', 'init_myplug_gateway', 0);
    function init_myplugin_gateway() {
        if ( ! class_exists( 'woocommerce_payment_gateway' ) ) return;
    	class woocommerce_myplugin extends woocommerce_payment_gateway {
    		public function __construct() {
    			global $woocommerce;

    What am I missing?
    Thanks a lot for any tip that could help me move on.

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘payment gateway Class not found’ is closed to new replies.