• Resolved Henry

    (@henrybaum)


    In Classic checkout, there’s only one radio button for Google Pay without a title and Paypal buttons are not displaying. In other installations, Google, Apple, and Paypal buttons are in the same gateway. It’s also not displaying the black credit card button.

    This works on other sites to display the credit card button:

    add_filter( 'woocommerce_paypal_payments_override_acdc_status_with_bcdc', '__return_true' );
    add_filter( 'pre_option_woocommerce_ppcp-card-button-gateway_settings', static fn() => [] );
    add_filter(
    'woocommerce_paypal_payments_sdk_disabled_funding_hook',
    static function( array $disable_funding, array $flags ) {
    if ( ( $flags['context'] ?? '' ) !== 'checkout' ) {
    return $disable_funding;
    }

    return array_filter(
    $disable_funding,
    static fn( string $funding_source ) => $funding_source !== 'card'
    );
    },
    100,
    2
    );

    When that code is disabled, advanced card processing comes up in a radio button, but it’s disabled in settings.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Krystian Syde

    (@inpsydekrystian)

    Hello @henrybaum

    Please disable the previous snippet and try the following one instead:

    add_filter( 'woocommerce_paypal_payments_sdk_disabled_funding_hook', function ( $disable_funding, $flags ) {
        if ( 'checkout' === $flags['context'] ) {
            // Classic checkout: make sure 'card' is enabled.
            $disable_funding = array_diff( $disable_funding, array( 'card' ) );
        } else {
            // Everywhere else: force 'card' disabled.
            $disable_funding[] = 'card';
        }
    
        return $disable_funding;
    }, 10, 2 );

    Please clear the site cache after applying it and check the checkout again. In case it fails please follow these steps to share your system status report with us:

    1. Navigate to the WooCommerce / Status section in your site’s admin panel.
    2. Click on the Get system report button and then click Copy for support.
    3. Paste the report into our PrivateBin.
    4. After uploading, please share the link here so we can review the details thoroughly.

    We are waiting for your system reports to proceed with the analysis.

    Kind Regards
    Krystian

    Thread Starter Henry

    (@henrybaum)

    I get: The snippet was saved, but remains inactive due to this error: Syntax error, unexpected token “;”.

    Here’s Status: https://privatebin.syde.com/?1b31cd213a5e6a2a#DUdN4GA9Dr5hXyNwKoZUf9vayivFu1kV9ZfqZ2xbwRP9

    Plugin Support Krystian Syde

    (@inpsydekrystian)

    Hello @henrybaum

    Works fine on my end with my Code Snippets.

    Try implementing it in functions.php directly. Alternatively, try this:

    function custom_ppcp_card_funding( $disabled_funding, $flags ) {
    $context = isset( $flags['context'] ) ? $flags['context'] : '';

    if ( 'checkout' === $context ) {
    $disabled_funding = array_diff(
    $disabled_funding,
    array( 'card' )
    );
    } else {
    if ( ! in_array( 'card', $disabled_funding, true ) ) {
    $disabled_funding[] = 'card';
    }
    }

    return $disabled_funding;
    }

    add_filter(
    'woocommerce_paypal_payments_sdk_disabled_funding_hook',
    'custom_ppcp_card_funding',
    10,
    2
    );

    If anything fails reach out to us directly. You can get support by opening a ticket with our service desk here: Request Support. Please include this thread’s URL in your ticket for reference.

    Kind regards,
    Krystian

    Thread Starter Henry

    (@henrybaum)

    That code works, thanks. The reason they’re not showing up is this –

    <div id="ppc-button-ppcp-gateway" style="display: none;">

    I don’t have that added anywhere (in Avada global CSS or checkout page CSS) so I think it’s native. Googlepay and Apple also have display none. Display block is working for ppc-button-ppcp-gateway but not ppc-button-ppcp-googlepay.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.