FOX - Professioneller WooCommerce-Währungsumschalter

TeraWallet – Für WooCommerce

Plug-in-URL: https://wordpress.org/plugins/woo-wallet/

  • zu deinem aktuellen kind wp thema Datei functions.php nächsten Code hinzufügen:
    add_filter('woo_wallet_current_balance', function ($balance, $user_id) { if (class_exists('WOOCS')) { global $WOOCS; $balance = $WOOCS->woocs_exchange_value($balance); } return $balance; }, 10 , 2); add_filter('woo_wallet_amount', function ($betrag, $währung, $user_id) { if (class_exists('WOOCS')) { global $WOOCS; $betrag = $WOOCS->woocs_exchange_value($betrag); } return $betrag; }, 10, 3);
    
  • Im Ordner \wp-content\plugins\woo-wallet\includes\class-woo-wallet-wallet.php nächsten Code hinzufügen:
    //woocs $additional_info = ''; if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_use_geo_rules() AND get_option('woocs_show_approximate_amount', 0)) { $user_currency = $WOOCS->get_currency_by_country($WOOCS->storage->get_val('woocs_user_country')); $währungen = $WOOCS->get_currencies(); if ($user_currency != $WOOCS->aktuelle_Währung AND!empty($user_currency) AND $balance) { $tmp_curr_currency = $WOOCS->aktuelle_Währung; $WOOCS->set_currency($user_currency); $decimal_separator = $WOOCS->get_decimal_sep($user_currency); $thousand_separator = $WOOCS->get_thousand_sep($user_currency); $guthaben = $WOOCS->woocs_exchange_value($guthaben); $wc_price = $WOOCS->wc_price($balance, true, array('thousand_separator' => $thousand_separator, 'decimal_separator' => $decimal_separator, 'decimals' => $WOOCS->get_currency_price_num_decimals($user_currency, $WOOCS-> price_num_decimals))); $zusätzliche_info = ' '; $additional_info .= apply_filters('woocs_get_approximate_amount_text', sprintf(esc_html__('(Ca. %s)', 'woocommerce-currency-switcher'), $wc_price), $wc_price); $zusätzliche_info .= ' '; $WOOCS->set_currency($tmp_curr_currency); } } } 'view' zurückgeben === $context ? wc_price($this->wallet_balance, woo_wallet_wc_price_args($this->user_id)) . $additional_info : number_format($this->wallet_balance, wc_get_price_decimals(), '.', '');
    

  • Fügen Sie in der Datei wp-content\plugins\woo-wallet\templates\wc-endpoint-wallet.php den nächsten Code hinzu:
    $zusätzliche_info = ''; if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_use_geo_rules() AND get_option('woocs_show_approximate_amount', 0)) { $user_currency = $WOOCS->get_currency_by_country($WOOCS->storage->get_val('woocs_user_country')); $währungen = $WOOCS->get_currencies(); if ($user_currency != $WOOCS->current_currency AND!empty($user_currency) AND $transaction->amount) { $curr_price = $transaction->amount; $tmp_curr_currency = $WOOCS->aktuelle_Währung; $WOOCS->set_currency($user_currency); $decimal_separator = $WOOCS->get_decimal_sep($user_currency); $thousand_separator = $WOOCS->get_thousand_sep($user_currency); $curr_price = $WOOCS->woocs_exchange_value($curr_price); $wc_price = $WOOCS->wc_price($curr_price, true, array('thousand_separator' => $thousand_separator, 'decimal_separator' => $decimal_separator, 'decimals' => $WOOCS->get_currency_price_num_decimals($user_currency, $WOOCS-> price_num_decimals))); $zusätzliche_info = ' '; $additional_info .= apply_filters('woocs_get_approximate_amount_text', sprintf(esc_html__('(Ca. %s)', 'woocommerce-currency-switcher'), $wc_price), $wc_price); $zusätzliche_info .= ' '; $WOOCS->set_currency($tmp_curr_currency); } } } echo $zusätzliche_info;