Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter sk3eter

    (@sk3eter)

    Hi,

    die Daten sind alle korrekt angelegt. Links stehen oben, aber hier nochmal:

    Beispiel, wie es funktioniert (Single Product):
    https://bit.ly/2Pmb5ih
    Beispiel, wo es nicht funktioniert (bzw. erst nach Abwahl der Variante): https://bit.ly/3cn4ltI

    Du wirst dann zur Seite über den Shortener weitergeleitet.

    Danke!

    Thread Starter sk3eter

    (@sk3eter)

    Well somehow it’s not causing this error anymore,

    but i still got a problem with the gateways.
    If i follow your description and find out the arrays in URL, then my code looks something like this:

    function pw_gift_card_payment_methods( $available_gateways ) {
        $redeeming_gift_card = false;
    
        if ( defined( 'PWGC_SESSION_KEY' ) ) {
            $session_data = (array) WC()->session->get( PWGC_SESSION_KEY );
            if ( isset( $session_data['gift_cards'] ) && count( $session_data['gift_cards'] ) > 0 ) {
                $redeeming_gift_card = true;
            }
    
            if ( $redeeming_gift_card === true ) {
                // Klarna Checkout
    			unset( $available_gateways['mollie_wc_gateway_klarnapaylater'] );
    			unset( $available_gateways['mollie_wc_gateway_klarnasliceit'] );
            }
        }
    
        return $available_gateways;
    }

    However it’s not unsetting both variations of Klarna Payment (Invoice [Paylater] and Installments [Slice It]. Only one of them if I try to unset both.

    Am I doing something wrong here?

    We are using Mollie as multiple Gateway Provider.

    Hope you can help me out here.

    Kind regards,
    Daniel

    Thread Starter sk3eter

    (@sk3eter)

    Hi there,

    that Snippet worked like a charm but for only one week.
    Now it’s causing a critical system error and the gateways are still showing up in the checkout. I’ve checked if there were any changes in the gateway names, but there aren’t.

    Can you please double check what happened here? Any Update maybe?

    Kind regards,
    Daniel

    Thread Starter sk3eter

    (@sk3eter)

    Found a solution. No need to investigate here.

    Thread Starter sk3eter

    (@sk3eter)

    It would be great if we can exclude Klarna as payment gate as long as gift card is applied to cart to use it as a temporary solution.

    I tried this Snippet, but this seems to NOT to the trick here in my case:

    add_filter(‘woocommerce_available_payment_gateways’, ‘unset_gateway_by_applied_coupons’);

    function unset_gateway_by_applied_coupons($available_gateways)
    {

    $coupons = WC()->cart->applied_coupons;

    if (!empty($coupons)) {
    unset($available_gateways[‘klarnapaylater’]);
    }

    return $available_gateways;
    }

    Can you help here?

    Kind regards,
    Daniel

    • This reply was modified 5 years, 6 months ago by sk3eter.
    • This reply was modified 5 years, 6 months ago by sk3eter.
Viewing 5 replies - 1 through 5 (of 5 total)