FOX - Professioneller WooCommerce-Währungsumschalter

woocs_currency_data_manipulation

Dieser Haken verwendet in public function get_currencies des Plugins:

öffentliche Funktion get_currencies() { $default = array( 'USD' => array( 'name' => 'USD', 'rate' => 1, 'symbol' => '$', 'position' => 'right ', 'is_etalon' => 1, 'description' => 'US-Dollar', 'hide_cents' => 0, 'flag' => '', ), 'EUR' => array( 'name' => 'EUR ', 'rate' => 0.89, 'symbol' => '€', 'position' => 'left_space', 'is_etalon' => 0, 'description' => 'Europischer Euro', 'hide_cents' => 0 , 'flagge' => '', ) ); $currencies = get_option('woocs', $default); $currencies = apply_filters('woocs_currency_data_manipulation', $currencies); if (empty($currencies) OR ! is_array($currencies)) { $currencies = $default; } geben $währungen zurück; }

Sie können es also für alle Manipulationen mit den Währungsdaten verwenden.

Beispiel:

add_filter('woocs_currency_data_manipulation', 'my_woocs_currency_data_manipulation', 1, 1); function my_woocs_currency_data_manipulation($currencies) { foreach ($currencies as $key => $value) { if ($key == 'USD') { $currencies[$key]['rate'] = $value['rate'] + 0.10; brechen; } } return $währungen; }

P.S. Ab v.2.2.9/1.2.9 ist es möglich, den Zinssatz zum Währungskurs direkt in der Registerkarte „Währungsoptionen“ hinzuzufügen!!