Last active
December 28, 2015 20:29
-
-
Save amdrew/7557921 to your computer and use it in GitHub Desktop.
Change the purchase button text and append the price in Easy Digital Downloads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function edd_custom_edd_checkout_button_purchase() { | |
| global $edd_options; | |
| $color = isset( $edd_options[ 'checkout_color' ] ) ? $edd_options[ 'checkout_color' ] : 'gray'; | |
| $color = ( $color == 'inherit' ) ? '' : $color; | |
| $style = isset( $edd_options[ 'button_style' ] ) ? $edd_options[ 'button_style' ] : 'button'; | |
| $button_label = 'Pay ' . edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ); | |
| ob_start(); | |
| ?> | |
| <input type="submit" class="edd-submit <?php echo $color; ?> <?php echo $style; ?>" id="edd-purchase-button" name="edd-purchase" value="<?php echo $button_label; ?>"/> | |
| <?php | |
| return ob_get_clean(); | |
| } | |
| add_filter( 'edd_checkout_button_purchase', 'edd_custom_edd_checkout_button_purchase' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment