Home Forums Plugins CURCY – WooCommerce Multi Currency Code crash when $price is “false” in wmc_revert_price(functions.php – 176)

Code crash when $price is “false” in wmc_revert_price(functions.php – 176)

  • Author
    Posts
  • #224383

    Audun Wilhelmsen
    Participant

    I have to change from

    return $rate ? $price / $rate : ”;

    to

    return ($rate && $price!=”false”) ? $price / $rate : ”;

    to get website back on. Seams that its not handling $price good when it for some reason is text(!)…

    Talking about this function:

    function wmc_revert_price( $price, $currency_code = ” ) {
    if ( ! $price ) {
    return false;
    }
    $setting = WOOMULTI_CURRENCY_Data::get_ins();
    $current_currency = $setting->get_current_currency();
    $currency = $currency_code ? $currency_code : $current_currency;
    $rate = wmc_get_exchange_rate( $currency );

    return $rate ? $price / $rate : ”;
    }

You must be logged in to see replies to this topic. Click here to login or register