How to define a variable already defined in a plugin function?

Question

I’m using a theme that display hotel rooms with a $ currency.
but i wish to display € as currency.

when requested the theme developper says, define currency in woocommerce.
that works great, because theme use this to display currency.

perhaps, we don’t use woocommerce on this site, so when i deactivate woocommerce, currency goes back to $ !

the theme developper has no idea on how to handle this.
So i make my search.

i do find the function that define the currency if woocommerce is not installed. It comes with a plugin linked to the theme.

    if ( ! function_exists('mkdf_hotel_room_get_currency') ) {
    /**
     * Get currency
     * @return string of currency that is used in woocommerce or default currency
     */
    function mkdf_hotel_room_get_currency() {
        $currency = '$'; // default currency if woocommerce is not installed
        if ( fivestar_mikado_is_woocommerce_installed() ) {
            $currency = get_woocommerce_currency_symbol( get_woocommerce_currency() );
        }

        return $currency;
    }
}

so now, the question, is how can i do to change this currency thru my functions.php ? i don’t want to change it in this code, to handle updates.

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/how-to-define-a-variable-already-defined-in-a-plugin-function/">

How to define a variable already defined in a plugin function?</a>
0
, Gregory 2 months 0 Answers 25 views 0

Leave an answer