• Resolved huusmann

    (@huusmann)


    Hi there

    I have just added an extra fee / surcharge at checkout for a specific country.

    However, it’s not displaying the correct value and it won’t change currency rate, when switching between the currencies on my site. I am using WooCommerce Multi Currency to change between the currencies.

    Here’s the code I applied in functions.php to display the surcharge on checkout:

    /**
    * Add a standard $ value surcharge to all transactions in cart / checkout
    */
    add_action( ‘woocommerce_cart_calculate_fees’,’woocommerce_custom_surcharge’ );
    function woocommerce_custom_surcharge() {
    global $woocommerce;

    if ( is_admin() && ! defined( ‘DOING_AJAX’ ) )
    return;

    $county = array(‘NO’);
    $fee = 135.00;

    if ( in_array( WC()->customer->get_shipping_country(), $county ) ) :
    $woocommerce->cart->add_fee( ‘Toldafgift’, $fee, true, ‘standard’ );
    endif;
    }
    }

    Any help would be great appreciated.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change currency of surcharge on checkout’ is closed to new replies.