Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AutomateWoo: Make generated coupon descriptions match the template coupon
<?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