YITH WooCommerce Account Funds
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$amount = $amount / $rate;
}
}
}
Fügen Sie in der Datei \wp-content\plugins\yith-woocommerce-account-funds-premium\includes\class.yith-ywf-customer.php den folgenden Code ein (zweimal, wie im Bild unten):
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->current_currency != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$new_funds = $new_funds / $currencies[$WOOCS->current_currency]['rate'];
}
}
Löschen Sie in der Datei \wp-content\plugins\yith-woocommerce-account-funds-premium\includes\class.wc-gateway-yith-funds.php den folgenden Code:
Fügen Sie in der Datei functions.php des aktuellen WordPress-Themes den folgenden Code ein:
<?php
add_filter('yith_show_available_funds', function($fund_av) {
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$fund_av = $WOOCS->woocs_exchange_value($fund_av);
}
}
return $fund_av;
});
add_filter('yith_show_used_funds', function($fund_av) {
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$fund_av = $WOOCS->woocs_exchange_value($fund_av);
}
}
return $fund_av;
});
add_filter('yith_min_deposit', function($fund_av) {
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$fund_av = floor($WOOCS->woocs_exchange_value($fund_av));
}
}
return $fund_av;
});
add_filter('yith_max_deposit', function($fund_av) {
if (class_exists('WOOCS') AND $fund_av) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$fund_av = ceil($WOOCS->woocs_exchange_value($fund_av));
}
}
return $fund_av;
});