• Resolved newshop

    (@newshop)


    Gerade habe ich ein Update auf Version 2.0.0 vorgenommen und das hat mir die Seite zerschossen:

    Fatal error: Uncaught Error: Call to a member function __isset() on null in …/wp-content/plugins/woo-paypalplus/src/Session/WooCommerceSession.php:80 Stack trace: #0 …/wp-content/plugins/woo-paypalplus/src/Session/WooCommerceSession.php(43): WCPayPalPlus\Session\WooCommerceSession->has(‘chosen_payment_…’) #1 …/wp-content/plugins/woo-paypalplus/src/Gateway/CurrentPaymentMethod.php(48): WCPayPalPlus\Session\WooCommerceSession->get(‘chosen_payment_…’) #2 …/wp-content/plugins/woo-paypalplus/src/ExpressCheckoutGateway/CheckoutGatewayOverride.php(50): WCPayPalPlus\Gateway\CurrentPaymentMethod->payment() #3 …/wp-includes/class-wp-hook.php(286): WCPayPalPlus\ExpressCheckoutGateway\CheckoutGatewayOverride->maybeOverridden(Array) #4 …/wp-includes/plugin.php(208): WP_Hook->apply_filters(Array, Array in …/wp-content/plugins/woo-paypalplus/src/Session/WooCommerceSession.php on line 80

    Hab das Plugin nun via FTP deaktiviert und würde mich über schnelle Hilfe bzw. Korrektur freuen.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Andreas W.

    (@aweissinpsyde)

    Hallo @newshop Kannst du uns bitte den WC Status Report zur verfügung stellen. Alternatv auch gerne an [email protected] senden. Vielen Dank

    Plugin Support Andreas W.

    (@aweissinpsyde)

    @newshop bitte deaktiviere auch testweise alle anderen Plugins. Möglicherweise verursacht hier ein anderes Plugin diesen Fehler

    Thread Starter newshop

    (@newshop)

    Ich hab den Fehler gefunden, ich hatte folgenden Code in meiner functions.php stehen, weil ich die Bankdetails auf der Danke-Seite nicht anzeigen möchte:

    add_action( 'init', 'remove_bacs_from_thank_you_page', 100 );
    function remove_bacs_from_thank_you_page() {
    // Bail, if we don't have WC function
    if ( ! function_exists( 'WC' ) ) {
    return;
    }
    // Get all available gateways
    $available_gateways = WC()->payment_gateways()->get_available_payment_gateways();	
    // Get the Bacs gateway class
    $gateway = isset( $available_gateways['bacs'] ) ? $available_gateways['bacs'] : false;	
    // We won't do anything if the gateway is not available
    if ( false == $gateway ) {
    return;
    }
    // Remove the action, which places the BACS details on the thank you page
    remove_action( 'woocommerce_thankyou_bacs', array( $gateway, 'thankyou_page' ) );
    }

    Wie muss ich den Code modifizieren, damit er weiterhin mit eurem Plugin kompatibel ist? Bis vor Version 2.0.0 hatte er ja keine Probleme gemacht…

    Plugin Support Andreas W.

    (@aweissinpsyde)

    Hallo @newshop, kannst du bitte es einmal so probieren

    add_action(‘woocommerce_init’, ‘remove_bacs_from_thank_you_page’, 100);

    Vielen Dank

    Thread Starter newshop

    (@newshop)

    Danke, gerade ausprobiert, aber leider kommt immernoch der FatalError..

    Plugin Support Andreas W.

    (@aweissinpsyde)

    Hallo @newshop

    kannst du das bitte einmal so abändern?

    add_action('woocommerce_init', 'remove_bacs_from_thank_you_page', 100);
    function remove_bacs_from_thank_you_page()
    {
        if (is_admin()) {
            return;
        }
    
        // Bail, if we don't have WC function
        if (!function_exists('WC')) {
            return;
        }
    
        // Get all available gateways
        $available_gateways = WC()->payment_gateways()->get_available_payment_gateways();
        // Get the Bacs gateway class
        $gateway = isset($available_gateways['bacs']) ? $available_gateways['bacs'] : false;
        // We won't do anything if the gateway is not available
        if (false == $gateway) {
            return;
        }
        // Remove the action, which places the BACS details on the thank you page
        remove_action('woocommerce_thankyou_bacs', [$gateway, 'thankyou_page']);
    }
    if (is_admin()) {
            return;
        }

    Vielen Dank

    Plugin Support Andreas W.

    (@aweissinpsyde)

    @newshop bitte auch das hier einmal testen

    add_action( 'woocommerce_thankyou_bacs', 'remove_bacs_from_thank_you_page', 5 );
    function remove_bacs_from_thank_you_page() {
        // Get all available gateways
        $available_gateways = WC()->payment_gateways()->get_available_payment_gateways();
        // Remove the action, which places the BACS details on the thank you page
        remove_action( 'woocommerce_thankyou_bacs', array( $available_gateways['bacs'], 'thankyou_page' ) );
    }

    Vielen Dank

    Thread Starter newshop

    (@newshop)

    Ja super, danke, das funktioniert beides.
    Die zweite Version ist ja etwas schlanker, d.h. die wäre zu bevorzugen oder?

    Plugin Support Andreas W.

    (@aweissinpsyde)

    @newshop Das freut mich zu hören. Wir würden uns über eine positive 5 Sterne Bewertung sehr freuen.

    Vielen Dank

    • This reply was modified 7 years, 1 month ago by Andreas W..
Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Version 2.0.0: Fatal error: Uncaught Error’ is closed to new replies.