Viewing 7 replies - 1 through 7 (of 7 total)
  • In line 199 of admin/class-pay4pay-admin.php add

    global $woocommerce;

    and in 200 replace

    WC()

    with

    $woocommerce

    Then probably the warning should not show up again.

    Thread Starter ChrisPrefect

    (@chrisprefect)

    Thank you, I made the changes:

    lines 196 to 205

    foreach ( $defaults as $option_key => $default_value )
    			if ( array_key_exists( $option_key, $form_fields ) )
    				$form_fields[$option_key]['default'] = $default_value;
    
    		global $woocommerce;
    		foreach ( $woocommerce()->payment_gateways()->payment_gateways() as $gateway_id => $gateway ) {
    			$form_fields['pay4pay_item_title']['default'] = $gateway->title;
    			$gateway->form_fields += $form_fields;
    			add_action( 'woocommerce_update_options_payment_gateways_'.$gateway->id , array($this,'update_payment_options') , 20 );
    		}

    But it still crashes on me:

    [Mon Nov 02 10:46:53 2015] [warn] [client 162.158.90.56] mod_fcgid: stderr: PHP Fatal error: Function name must be a string in /home/dronefactory/public_html/wp-content/plugins/woocommerce-pay-for-payment/admin/class-pay4pay-admin.php on line 201

    Thread Starter ChrisPrefect

    (@chrisprefect)

    I still cant use the plugin. I am loosing money on every order ?? Any hints?

    Thank you!
    Chris

    mpbm23

    (@mpbm23)

    Have you checked your hosting.
    Check your php version.
    This error does not seem right and I can not reproduce it.
    Can you comment out some of the code to pin point exactly the error’s origin?

    mpbm23

    (@mpbm23)

    Also in

    foreach ( $woocommerce->payment_gateways()->payment_gateways() as $gateway_id => $gateway )

    without ()

    Thread Starter ChrisPrefect

    (@chrisprefect)

    without () did the trick, thank you!!

    I hope the plugin gets updated soon.

    Have a nice weekend!
    Chris

    Hi ! I’m having similar issue with plugin pay for payment. I use WP Multisite
    “Fatal error: Call to undefined function WC() in…..woocommerce-pay-for-payment/admin/class-pay4pay-admin.php on line 200”
    Could you please tell me how to fix this on a multiste?
    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WooCommerce 2.4.8 leads to Server Error 500’ is closed to new replies.