• Resolved icarleug

    (@icarleug)


    Hello!

    I am trying to add a custom exchange rate api supplier for the multicurrency automatic updates in my child themes’ functions.php, however I cannot get any options to actually show up in the settings.

    I guess I am adding the action to the wrong hook, is there a better place to add the extension after the class has just been initialized?

    add_action( 'wcml_before_multi_currency_ui', 'extend_wcml', 15 );
    
    function extend_wcml() {
    	
    	global $woocommerce_wpml;
    	$woocommerce_wpml->multi_currency->exchange_rate_services->add_service( 'exchangeratehost', new WCML_Exchange_Rates_ExchangerateHost() );
    
    }
    
    /**
     * Class WCML_Exchange_Rates_ExchangerateHost
     */
    class WCML_Exchange_Rates_ExchangerateHost extends WCML_Exchange_Rate_Service {
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi!

    Apologies for the delayed response. We are in the middle of a release at the moment and all hands are busy working on our support forums.

    I’m looking into it and have asked for one of our WCML developers for some input as this is not a documented use case as far as I could find.

    For more effective support for specific issues, I recommend opening a ticket in our support forums:
    https://wpml.org/forums/forum/english-support/

    Best,
    Izzi

    Hi,

    So, it looks like you’re doing things correctly other than hooking in too late.

    We suggest trying:
    add_action( 'init', 'extend_wcml', 10 );

    We are also working on better documentation for this and related features which should be published soon!

    Best,
    Izzi

    Thread Starter icarleug

    (@icarleug)

    It works! Thank you, now I can add an option that works without me having my base currency set to USD. ??

    Best Regards,
    Andreas

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom exchange rate host in multicurrency’ is closed to new replies.