This code-snippet let’s me pick how much extra I would like to charge a country. However, I would like it to be specifically for PayPal. Here is the snippet to add based on country:

    add_action( 'woocommerce_cart_calculate_fees','wc_add_betalavgift' );
function wc_add_betalavgift() {
global $woocommerce;

if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;

$county = array('SE');
// change the $fee to set the surcharge to a value to suit
$fee = 29.00;

if ( !in_array( WC()->customer->get_shipping_country(), $county ) ) :
    $woocommerce->cart->add_fee( 'Betalavgift', $fee, true, 'standard' );  
endif;
}

I need somehow the code to work as above to only work if payment is going through PayPal.

Any suggestions?

Read more here: Charing extra based on country AND payment option – WooCommerce


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: