Buy All 40 Premium WordPress Themes for $54.99

How to Translate WooCommerce Sorting Select

How to Translate WooCommerce Sorting Select

Here is a guide if you need to translate the WooCommerce Sorting Select including the sorting options (it is applicable to any WordPress theme):

1. Login to your Admin Panel

2. Navigate to Left Menu -> Appearance -> Theme Editor

3. Open functions.php

4. At the end of the file (just above last ‘?>‘) insert the following code:

function tishonator_customize_product_sorting($sorting_options){
    $sorting_options = array(
        'menu_order' => __( 'Sorting', 'tishonator' ),
        'popularity' => __( 'Sort by popularity', 'tishonator' ),
        'rating'     => __( 'Sort by average rating', 'tishonator' ),
        'date'       => __( 'Sort by newness', 'tishonator' ),
        'price'      => __( 'Sort by price: low to high', 'tishonator' ),
        'price-desc' => __( 'Sort by price: high to low', 'tishonator' ),
    );

    return $sorting_options;
}

add_filter('woocommerce_catalog_orderby', 'tishonator_customize_product_sorting');

5. Replace string values for sorting, i.e.

'menu_order' => __( 'Sorting', 'tishonator' )

to:

'menu_order' => __( 'Сортиране', 'tishonator' )

6. Save changes

Leave a Reply