• Resolved anjanphukan

    (@anjanphukan)


    Hi,

    I am woocommerce to sell classes for different schools. So, I want to change all occurrence of the word “product” to “school” in the front-end, order email and backend if possible.

    So that the title in the tables in cart (screenshot) and checkout (screenshot) pages. Plus it should be changed to “School” in the order confirmation, order, email, etc.

    Please let me know if I am not clear enough.

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,
    You can define that in the WordPress Settings / Permalinks settings tab.

    ( yoursite.com/wp-admin/options-permalink.php )

    Thread Starter anjanphukan

    (@anjanphukan)

    Hi

    Thanks for the reply. But sorry that is not what I meant. I don’t want to change the slug. I actually want to change the word “Product” to “School” in front end and order emails. Please check the screenshots to understand what I refer to.

    Thanks

    The easiest and most safe way to do that is to install the Loco Translate free plugin, which allows to edit language files, then search & replace whatever you need.

    Thread Starter anjanphukan

    (@anjanphukan)

    Hi,

    Thanks. Is that the only way to do this? Instead of installing a plugin for this, can we not do this with some function or hook?

    Will this plugin change the text in order emails as well?

    You can do this with function (add_filter), although I cant point you which ones you need, so unless someone else does, you need to find it out by yourself, you can do this by editing Woo template files or you can do it with editing language files (Loco Translate). The plugin is completely harmless, it only works when you access it (it is a plugin for editing files), and does not slow down your site a bit. You can even delete it after making your edits and the changes are going to stay. *Until the next update overwrites them.

    Thread Starter anjanphukan

    (@anjanphukan)

    Okay I found the solution.

    add_filter( 'gettext', 'change_woocommerce_product_text', 20, 3 );
    
    function change_woocommerce_product_text( $translated_text, $text, $domain ) {
    	switch ( $translated_text ) {
    		case 'Product' :
    			$translated_text = __( 'School', 'woocommerce' );
    			break;
    	}
        return $translated_text;
    }

    Thank you.

    • This reply was modified 7 years, 9 months ago by anjanphukan.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change “Product” to something else’ is closed to new replies.