Created
April 1, 2026 07:36
-
-
Save webtoffee-git/3e0cd8a44065d132f86fe40c4a666ec9 to your computer and use it in GitHub Desktop.
Replace “Buy X Get X/Y” with custom text in the Smart Coupons Basic plugin - By WebToffee (Smart Coupon Basic)
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 //Do not copy this line of code | |
| add_filter( 'wt_smart_coupon_meta_data', function ( $coupon_data, $coupon ) { | |
| $coupon_id = isset( $coupon_data['coupon_id'] ) ? (int) $coupon_data['coupon_id'] : 0; | |
| if ( ! $coupon_id || ! is_a( $coupon, 'WC_Coupon' ) ) { | |
| return $coupon_data; | |
| } | |
| if ( 'wbte_sc_bogo' === $coupon->get_discount_type() ) { | |
| $coupon_data['coupon_type'] = __( 'Redeem Now', 'wt-smart-coupons-for-woocommerce' ); | |
| } | |
| return $coupon_data; | |
| }, 20, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment