Created
April 3, 2020 21:47
-
-
Save NickGreen/e8a51dc1cdf95cbd6bc1622bc506bcc9 to your computer and use it in GitHub Desktop.
Replace coupon amount display with a string
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 // don't copy this line | |
| add_filter( 'woocommerce_cart_totals_coupon_html', 'custom_cart_totals_coupon_html', 30, 3 ); | |
| function custom_cart_totals_coupon_html( $coupon_html, $coupon, $discount_amount_html ) { | |
| $discount_amount_html = '<span>Redeemed</span>'; | |
| $coupon_html = $discount_amount_html . ' <a href="' . esc_url( add_query_arg( 'remove_coupon', urlencode( $coupon->get_code() ), defined( 'WOOCOMMERCE_CHECKOUT' ) ? wc_get_checkout_url() : wc_get_cart_url() ) ) . '" class="woocommerce-remove-coupon" data-coupon="' . esc_attr( $coupon->get_code() ) . '">' . __( '[Remove]', 'woocommerce' ) . '</a>'; | |
| return $coupon_html; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment