• Resolved raymondreddington

    (@raymondreddington)


    Hello everyone,

    I use the Curcy plugin to offer my customers multi-currency payments.

    Everything works fine so far, I just have one problem.

    I am using a PHP code to set a minimum order value for a specific payment method.

    Unfortunately, this only works for the default currency (400 €).

    But if someone pays with e.g. Hungarian Forint, he can already pay from 1€ (400 Forint).

    Maybe someone can help me?


    I use the following code:

    add_filter( 'woocommerce_available_payment_gateways', 'show_hide_cod_payment_gateway' );
    function show_hide_cod_payment_gateway( $available_gateways ) {
    // Only on checkout page
    if ( ! ( is_checkout() && ! is_wc_endpoint_url() ) )
    return $available_gateways;

    // Set the targeted cart total
    $targeted_total = 400;

    // Check if the order total is less than or equal to the minimum for COD payment
    if ( WC()->cart->total <= $targeted_total && isset($available_gateways['cod']) ) {
    unset($available_gateways['cod']);
    }
    return $available_gateways;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    Thanks for reaching out.

    This involves custom code, which is unfortunately outside our support scope. Please refer to our developer documentation for guidance – it includes functions that help with currency handling.

    You’ll need to find a way to convert the price to the current currency and apply your condition based on that. It should help you achieve the behavior you’re looking for.

    Thanks for your understanding!

    Best regards.

    Thread Starter raymondreddington

    (@raymondreddington)

    Unfortunately, I have no idea how to do this.

    Can anyone help me, please? 😇

    Unfortunately, we’re unable to assist with custom code or customization requests. You might consider checking with a developer or asking in community forums for help with this

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

The topic ‘PHP code minimum order value only applies to default currency’ is closed to new replies.