duaner5714 2015-04-28 14:57
浏览 69
已采纳

Wordpress WPML - 以编程方式设置货币

I'm using WPML and WooCommerce Multilingual with multicurrency setting. I'm detecting geolocation of visitor via geoplugin.net to set up site language.

I want to set up currency also and here's a question:

Is there a way to set up currency programmatically in WooCommerce Multilingual? I tried do_action('wcml_switch_currency', $_curr); where $_curr = 'GBP';' with no luck :/.

  • 写回答

1条回答 默认 最新

  • dongzhun4898 2015-04-28 15:34
    关注

    I figured it out via filter, this is example:

    add_filter('wcml_client_currency', 'wcml_custom_currency');
    function wcml_custom_currency($current){
        return 'GBP'; 
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?