Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • To describe better my case – we have woocommerce + woocommerce multilingual (WPML) which gives us the possibility to use different currencies for different languages. All payment gateways we use check the supported currency using main currency configuration of woocommerce. That’s why the site is set to main currency EUR because the other gateways don’t support BGN and cannot be activated. With this setting and BGN as additional currency all other installed gateways are working as expected:
    1. they are active because the main currency is EUR
    2. they are available when the order is in EUR because the currency is supported
    3. They are not available when the order is in BGN because the currency is not supported.
    ———————–
    For ePay.bg gateway the supported currencies are BGN EUR USD.
    1. This makes the gateway enabled with main currency EUR
    2. the gateway is available when the order currency is BGN
    3. WRONG – The gateway is available when the order currency is EUR.
    The function is_currency_supported cannot be changed because it will disable the gateway in my configuration

    To be able to fix this I added one more function to class-wc-gateway-epaybg.php
    —————-
    public function is_currency_valid() {
    return in_array(get_woocommerce_currency(), array( ‘BGN’));
    }
    —————-
    And changed is_valid_for_use to
    —————-
    public function is_valid_for_use() {
    //return $this->client_id && $this->secret_key && $this->is_currency_supported();
    return $this->client_id && $this->secret_key && $this->is_currency_valid();
    }
    —————-
    Now everything is working as needed for us

    Здравейте,
    Дали имате вече решение на проблема.
    В конкретния случай става дума за сайт който е multi-currency в зависимост от езика, и бих искал метода за плащане да не се появява ако ордера е в EUR.

    Thread Starter dymitar

    (@dymitar)

    you are awesome
    thank you

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