WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Change Woocommerce Sort By Text (7 posts)

  1. elogichick
    Member
    Posted 1 year ago #

    On the catalog page, I'm looking to change the wording in the Sort By dropdown, the one that says 'Newness' I'd like to change that to 'Newest'. Does anyone know how I can do this?

    http://wordpress.org/extend/plugins/woocommerce/

  2. tbuys
    Member
    Posted 1 year ago #

    Yes,

    Use FileZilla or another FTP to access your root directory, and navigate to:

    wp-content/plugins/woocommerce/templates/loop/orderby.php

    Once you find "orderby.php" click the file to highlight it, then right click and choose "View/Edit"

    You will see the values you are looking to change within the file - e.g. "Newness." Change those to whatever you want.

    Simply close the file to save your changes. Refresh your page to see them. Cheers.
    _______

    Does anyone reading this know how to change the characteristics of the "Sort By" button itself - e.g. make it smaller, change the colors, etc? I'm looking for the file to be able to do this

  3. elogichick
    Member
    Posted 1 year ago #

    Thanks for your help, but that's the problem. I can't find that piece of code at all. There is no orderby.php in the Loops folder, there is a sorting.php but it doesn't have the 'Newness' I'm looking for. I tried looking all over the Woocommerce folder. Any help with where I can find it?

  4. tbuys
    Member
    Posted 1 year ago #

    Hmm, my update to WooCommerce 2.0 came with the orderby.php file (which included the "Sort by newness" option).

    I'm looking at the older "sorting.php" file and see that the code for changing the sort by title text is there (e.g. "default sorting," etc.).

    Do you have more than one WooCommerce shop set up under your current host? Could you be in the wrong woocommerce/templates/loop/ folder? Sorry I can't be of more help.

  5. truthlighthouse
    Member
    Posted 10 months ago #

    This worked for me. I wonder if you are trying to find "orderby" within the admin editor panel of WordPress (meaning online) versus going to your hosting provider and navigating to the FTP section and editing the PHP file that way. For me, I am hosted with Godaddy so I go to Godaddy.com and log in and then navigate to my account area and then click hosting->click launch for the particular hosted account I want->click Files & FTP at the top left->file manager->and then navigate to the file that was listed in the above response.

  6. Harish Chouhan
    Member
    Posted 8 months ago #

    Hello,

    If you do not wish to use the template, then another way to change the text would be to add this:

    add_filter( 'gettext', 'theme_sort_change', 20, 3 );
    function theme_sort_change( $translated_text, $text, $domain ) {
    
        if ( is_woocommerce() ) {
    
            switch ( $translated_text ) {
    
                case 'Sort by newness' :
    
                    $translated_text = __( 'Sort by Newest', 'theme_text_domain' );
                    break;
            }
    
        }
    
        return $translated_text;
    }

    Check http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext for more details. I have used this method to avoid having to update templates if and when WooCommerce does any major update.

  7. herchen
    Member
    Posted 1 month ago #

    This is absolutely the best way to do this. Do not modify system files because those files may be modified when future versions of plugins are updated.

    I just used this on a client site and it works perfectly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic