Is there a Woocommerce hook that fires when applying a coupon but before checking if it’s valid?

Its the woocommerce_get_shop_coupon_data filter, example code: add_filter ( ‘woocommerce_get_shop_coupon_data’, ‘mp_create_coupon’, 10, 2 ); function mp_create_coupon( $data, $code ) { // Check if the coupon has already been created in the database global $wpdb; $sql = $wpdb->prepare( “SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type=”shop_coupon” AND post_status=”publish” ORDER BY post_date DESC LIMIT 1;”, $code … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)