Problem after update – “internal error” after trying to pay

This topic has 2 replies, 2 voices, and was last updated 11 months, 2 weeks ago ago by Rose Tyler

  • Avatar: Basshunterek
    Basshunterek
    Participant
    May 11, 2023 at 17:21

    Hello,

    Today I updated my website to the latest version of XStore and XStore core.

    Now I’m having some issues with a custom functions.php code, that I was using to hide one of the payment methods with certain shipping methods.

    This piece of code was:

    add_filter( 'woocommerce_available_payment_gateways', 'payment_gateways_based_on_chosen_shipping_method' );
    function payment_gateways_based_on_chosen_shipping_method( $available_gateways ) {
        // Not in backend (admin) and Not in order pay page
        if( is_admin() ||  is_wc_endpoint_url('order-pay') ) 
            return $available_gateways;
         
        // Get chosen shipping methods
        $chosen_shipping_methods = (array) WC()->session->get( 'chosen_shipping_methods' );
    
        if ( in_array( 'flexible_shipping_single:28', $chosen_shipping_methods ) )
        {
            unset( $available_gateways['przelewy24'] );
        }
        elseif ( in_array( 'flexible_shipping_single:29', $chosen_shipping_methods ) )
        {
            unset( $available_gateways['przelewy24'] );
        }
        return $available_gateways;
    }

    After the update I had to comment it out, because it started giving “internal error” message after trying to pay with this “przelewy24” payment method.

    Could you verify it?

    Please, contact administrator
    for this information.
    1 Answer
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 12, 2023 at 09:20

    Hello, Basshunterek,

    Thank you for contacting us and for using XStore.

    We can see several issues with third-party plugins, and an error log file has been attached – https://we.tl/t-1xOAeYOdSt
    Please try to reproduce the error without using third-party plugins and with a default WP theme.
    In any case, we are not responsible for any third-party customizations, sorry.

    Kind Regards,
    8theme team

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.