Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › Add a coupon that adds a coupon › Reply To: Add a coupon that adds a coupon
Yes I already do some of this.
but this sort of hard-coded stuff would very easily get out of date with changes to coupons made by the shop manager.
Actually I think it should be quite easy to do some sort of enhancement with the plugin. I mean it seems crazy to write extra code to auto-add a coupon when the auto-add coupons already has all the logic for this.
For the theme code, instead of echo, use wc_add_notice() for a separate message, or simply implement as:
function my_check_offers($message, $products )
{
//check products added and add new coupons or messages
return $message;
}
add_filter( ‘wc_add_to_cart_message_html’, ‘my_check_offers’, 10, 2);