• 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;
    }
    }

    The code is currently disabled.

    Any help would be great appreciated.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Please replace the string: $fee = 135.00 in your code by this code: $fee = wmc_get_price(135);

    Best regards,

    Thread Starter huusmann

    (@huusmann)

    Hi,

    Many thanks for your reply.

    I have tried to replace the string as you suggested. Now it changes currency, but it’s not displaying the correct value = 135.00

    It’s showing DKK 168,75, but is should display DKK 135.00. Do you know why it does that? Is there anywhere I can change the currency to ‘DKK 135’?

    Any help is greatly appreciated.

    Kind regards,

    Hi,

    We need to understand more about your settings with Multi Currency to help you. It looks like you are using our pro version. Please create a thread on our support forum and we will help you to check that.

    Best regards,

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