К сожалению, это работает лишь частично, текст «Сортировать по» «Просто нельзя перевести». Указано, что существует только часть рабочего кода, даже если я использую тот же метод (вы можете найти его ниже). < /p>
Код: Выделить всё
function woosuite_change_cart_totals_text( $translated_text, $text, $domain ) {
if ( $text === 'Default Order' ) {
$translated_text = 'Výchozí';
}
if ( $text === 'Name' ) {
$translated_text = 'Jméno';
}
if ( $text === 'Popularity' ) {
$translated_text = 'Oblíbené';
}
if ( $text === 'Sort by ' ) {
$translated_text = 'Řadit dle ';
}
return $translated_text;
}
add_filter( 'gettext', 'woosuite_change_cart_totals_text', 20, 3 );
Код: Выделить всё
add_filter('woocommerce_catalog_orderby', 'wc_customize_product_sorting');
function wc_customize_product_sorting($sorting_options){
$sorting_options = array(
'menu_order' => __( 'Řazení', 'woocommerce' ),
'popularity' => __( 'Oblíbenost', 'woocommerce' ),
'price' => __( 'Cena: od nejnižší', 'woocommerce' ),
'price-desc' => __( 'Cena: od nejvyšší', 'woocommerce' ),
);
return $sorting_options;
}
Спасибо за любую помощь!
Подробнее здесь: https://stackoverflow.com/questions/780 ... ng-options
Мобильная версия