من تمام این کدها را چک کردم و کاملا درست بودند
کدهای مخصوص اضافه کردن واحد جدید به ووکامرس در فایل function.php
function add_my_currency( $currencies ) {
$currencies['ABC'] = __( 'Toman', 'woocommerce' );
return $currencies;
}
// Add Toman to Currency
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
function add_my_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'ABC': $currency_symbol = 'تومان'; break;
}
return $currency_symbol;
}
و کدهای موجود در class-wc-gateway-bankmellat.php
$Amount = apply_filters( 'woocommerce_order_amount_total_IRANIAN_gateways_before_check_currency', $Amount, $currency );
if ( strtolower($currency) == strtolower('IRT') || strtolower($currency) == strtolower('Toman')
|| strtolower($currency) == strtolower('Iran TOMAN') || strtolower($currency) == strtolower('Iranian TOMAN')
|| strtolower($currency) == strtolower('Iran-TOMAN') || strtolower($currency) == strtolower('Iranian-TOMAN')
|| strtolower($currency) == strtolower('Iran_TOMAN') || strtolower($currency) == strtolower('Iranian_TOMAN')
|| strtolower($currency) == strtolower('تومان') || strtolower($currency) == strtolower('تومان ایران')
)
$Amount = $Amount*10;