Created
January 6, 2021 06:27
-
-
Save danielbitzer/a38effdbbfc89aea7e878c4cafad5f89 to your computer and use it in GitHub Desktop.
AutomateWoo: Make generated coupon descriptions match the template coupon
This file contains 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 | |
/** | |
* AutomateWoo: Make generated coupon descriptions match the template coupon. | |
* | |
* Requires AutomateWoo 5.2. | |
*/ | |
add_action( | |
'automatewoo/coupon_generator/generate_from_template_coupon', | |
function ( $coupon, $template_coupon ) { | |
/** | |
* @var \WC_Coupon $coupon The newly generated coupon object. | |
* @var \WC_Coupon $template_coupon The template coupon object. | |
*/ | |
$coupon->set_description( $template_coupon->get_description() ); | |
}, | |
10, | |
2 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment