Okay
  Public Ticket #4162849
Changing Vendor Info Display Name
Open

Comments

  •  12
    Ryan Dwyer started the conversation

    One of my vendor's was asking if the Vendor Info could be changed, for example, to Pianist Bio. I'm guessing there is an easy way through code? I also suggest in one of your future updates to create an option to change that in the admin area. (Perhaps that is already there and I missed it?)

  •  2,478
    WebWizards replied

    Hi Ryan,

    Do you mean changing texts here https://sheetmusicpianists.com/pianists/richbatsford/info/ such as "Vendor Details" and "Vendor Information" to custom texts?

    There's no built-in way to do that with the plugin, but you can do it with a code snippet:

    function change_vendor_info_text( $translated_text, $text, $domain ) {
        // Check if this is the correct text domain
        if ( $domain === 'marketking-multivendor-marketplace-for-woocommerce' ) {
            // Replace the specific text
            if ( $text === 'Vendor Information' || $translated_text === 'Vendor Information' ) {
                return 'Pianist Bio';
            }
    
            if ( $text === 'Vendor Details' || $translated_text === 'Vendor Details' ) {
                return 'Pianist Details';
            }
        }
        
        return $translated_text;
    }
    add_filter( 'gettext', 'change_vendor_info_text', 20, 3 );

     

    As you can see in the code, this changes 'Vendor Information' to 'Pianist Bio' and 'Vendor Details' to 'Pianist Details'. Feel free to change these to any text you would like.

     

    This code snippet can be added to functions.php or any snippets plugin. It can be extended to target any other texts as well.

     

    Kind regards,

    Stefan