chatGPT was able to fix this, lol
-
ok, my initial review was “it simply doesn’t work”, but with help of chatGPT and 4h of dedication i managed to fix this.
Just add this code as a snippet:function trigger_yith_waitlist_emails_for_all_products( $product_id ) {
$product = wc_get_product( $product_id );
if ( $product && $product->is_in_stock() ) {
YITH_WCWTL_Mailer()->schedule_email_send( $product );
error_log('Scheduled YITH Waitlist Email for Product ID ' . $product_id);
}
}
add_action( 'woocommerce_product_set_stock_status', 'trigger_yith_waitlist_emails_for_all_products', 10, 1 );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘chatGPT was able to fix this, lol’ is closed to new replies.