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?)
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.
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?)
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
Sorry for not checking if this is working. For some reason it isn't.
Hi Ryan,
I checked that now using the access credentials you shared in the other ticket,
A small change was needed in the code snippet.
I believe it's working correctly now:
Let me know if you see any issues or if you need any adjustments,
Kind regards,
Stefan
That looks fantastic. Much thanks!