• Resolved Erfan MHDi

    (@erfanmhd)


    hello,
    i’d like to know if you guys can help me changing the EDD “Complete Purchase” Button Text, inside “edd_templates/checkout_cart.php” file, under an if condition that i have?!

    P.S: i know normally we have to change it on WP BackEnd inside EDD setting page.
    but as i have an override for checkout_cart.php inside my theme i need to change the button text to something else depending on some “if” conditions inside this php file.

    Thanks.

    • This topic was modified 4 years, 1 month ago by Erfan MHDi.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @erfanmhd

    Yes, you can achieve this with below code snippet. You can check your condition in it. Please check your condition properly. I hope it will work for you.

    function __modify_edd_opts( $value, $key, $default ) {
    
    	// Your Condition Goes Here
    	/*if(  ) {
    		$value = 'Your Checkout Button Text';
    	}*/
    
    	return $value;
    }
    add_filter( 'edd_get_option_checkout_label', '__modify_edd_opts', 10, 3 );
    Thread Starter Erfan MHDi

    (@erfanmhd)

    Thanks @pratik-jain , you are my hero ??

    Hey @erfanmhd

    What condition are you using? I use EDD’s Stripe plugin and PayPal Standard on my checkout page and in the past I tried to figure out how to change the complete purchase button depending on which payment option was selected (I also use a custom checkout_cart.php page), but I could never get it working. Any guidance on how to do this? Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing “Complete Purchase Text ” inside PHP file’ is closed to new replies.