New Landing How can we help? Atelier How to change product filter term

Viewing 5 posts - 1 through 5 (of 5 total)
  • Posted in: Atelier
  • #265958
    keysilinares
    Member
    Post count: 165

    Hello,

    How can I change the product filter “newness” term to “newest”? (see attached) Please advise. Thanks!!

    Attachments:
    You must be logged in to view attached files.
    #265960
    keysilinares
    Member
    Post count: 165
    This reply has been marked as private.
    #266043
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php at child theme.

    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', $domain );
                    break;
            }
    
        }
    
        return $translated_text;
    }

    Thanks
    Mohammad

    #269218
    keysilinares
    Member
    Post count: 165

    That code was working up until I updated some plugins. Now that code caused my site to crash. Can you please provide a working code that won’t cause it to break? Do I run the risk of it breaking with every update?

    #269246
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    The code should work always. Whats error are you getting exactly?
    Thanks
    Mohammad

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register