• Resolved chrisreina

    (@chrisreina)


    Hi Gareth,

    Just wondering if it were possible to change the title of “Purchase Order Number*” above input field to different text in the code. We are using it for Education in schools – and they don’t use Purchase Orders – but do have Roll Numbers…

    Many thanks,

    Chris

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author gazchap

    (@gazchap)

    Hi Chris,

    I should be able to make a change like that within the plugin that gets that working, although to maintain the translation capabilities makes it a bit more complex so it’ll take a little while for me to think it through.

    In the meantime, you should be able to add this code to your theme’s functions.php:

    add_filter( 'gettext', 'change_gazchaps_po_number_field', 20, 3 );
    
    function change_gazchaps_po_number_field( $translated, $original, $textdomain ) {
    	
    	// only apply if we're on the checkout or in the admin panel
    	// and the text domain is the correct one
    	if ( ( is_checkout() || is_admin() ) && 'gazchaps-woocommerce-purchase-order-payment-gateway' == $textdomain ) {
    		
    		// change the various bits of text that mention "Purchase Order" to "Roll Number"
    		// replace your_textdomain with your theme's textdomain!
    		switch ( $translated ) {
    		
    			case "Purchase Order":
    				$translated = __( 'Roll Number', 'your_textdomain' );
    				break;
    				
    			case "Purchase Order Number":
    			case "PO Number":
    				$translated = __( 'Roll Number', 'your_textdomain' );
    				break;
    				
    			case "Please complete the Purchase Order details.":
    				$translated = __( 'Please complete the Roll Number details.', 'your_textdomain' );
    				break;
    		
    			case "Please enter a Purchase Order Number.":
    				$translated = __( 'Please enter a Roll Number.', 'your_textdomain' );
    				break;
    		
    		}
    		
    	}
    	
    	return $translated;
    	
    }
    

    Remember to change the occurrences of “your_textdomain” with the text domain you’re using in your theme, if known. You’ll also need to change the title for the payment method to “Roll Number” in the plugin settings 🙂

    Thread Starter chrisreina

    (@chrisreina)

    Hey Gareth,

    You’re very good for coming back to me at the weekend! Many thanks.

    I wonder if I may pick your brain tomorrow for 5 mins. I would be happy to make a donation to your plugin, or if you have support fees – I’m happy to pay these 🙂

    Many thanks,

    Chris

    Plugin Author gazchap

    (@gazchap)

    Hi Chris,

    Ack, I’ve just looked at this topic and saw that you replied again and I either didn’t notice the notification email or I didn’t get it – sorry!

    Do you still need assistance? If so, please email me (g at zchap.com) and I’d be happy to take a look 🙂

    Thanks,
    Gareth.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Small Change’ is closed to new replies.