Home Forums WoodMart support forum Waitlist Feature Not Sending Back-in-Stock Notifications

Waitlist Feature Not Sending Back-in-Stock Notifications

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #629125

    luciano
    Participant

    Hello,

    I’m currently running:
    WordPress 6.7.1
    WooCommerce 9.5.2
    Woodmart Theme 8.0.6

    I have enabled the Woodmart waitlist function and followed these steps:

    Set a product to “Out of Stock.”
    Signed up to the waitlist and received the “Confirm Waitlist” email successfully.
    Verified that my email is showing as subscribed on the product page.
    Returned the product back to “In Stock.”
    However, after the product is back in stock, no waitlist notification email is sent to the subscribed customers.

    I also checked my Cron Manager for any waitlist-related cron jobs (similar to the wishlist ones below), but I only see these cron entries:
    woodmart_wishlist_on_sales_products_email
    woodmart_wishlist_send_promotional_email
    woodmart_wishlist_send_back_in_stock_email
    woodmart_wishlist_register_on_sales_products
    woodmart_remove_not_confirmed_emails

    I don’t see any cron job related specifically to the waitlist. Is there a known cron job for the Woodmart waitlist that needs to run in order to send back-in-stock notifications? If so, is it possible to create or register this cron job manually?

    Could you please advise what further steps or settings I should check to troubleshoot this issue? Any guidance on manually creating the correct cron job or confirming the waitlist settings would be greatly appreciated.

    Thank you in advance for your assistance!

    #629161

    Artem Temos
    Keymaster

    Hello,

    Please disable any plugins not directly related to our theme and provide us with your admin access details. We will log in to your dashboard and investigate the issue. Please ensure that you only keep the following plugins that are necessary for our theme to work correctly:
    – WoodMart core
    – WooCommerce
    – Elementor/WPBakery Page Builder

    Thank you in advance.

    #633017

    luciano
    Participant

    Hello,

    I haven’t been able to deactivate all the plugins on our website, but I found a way to make the back-in-stock notification emails work. It seems to be a bug related to how we update the stock of our products.

    We update stock in bulk via Excel or API, and this method doesn’t seem to trigger the notification emails, even though the product is marked as available in WooCommerce. However, if I manually update the stock for each product individually through the WooCommerce product editor, the back-in-stock notification emails are sent without any issues.

    Could you confirm if this behavior is expected or if there is a workaround to ensure the notifications are triggered when updating stock in bulk?

    Thank you for your help.

    #633104

    Artem Temos
    Keymaster

    Hello,

    In this case, we need to be able to reproduce this on your website. Please describe in detail how you changed the stock status and send some screenshots.

    Kind Regards

    #633387

    luciano
    Participant

    Hello,

    We update the stock using the WPSheet plugin, as shown in the attached screenshot “Screenshot 2025-01-27 203548.” While this method correctly updates the product status to “In Stock” for items on the waitlist, the notification email is not sent. You can see this behavior in “Screenshot 2025-01-27 203431.”

    To send the notification email, we have to manually adjust the stock via the WooCommerce product editor. Specifically, we set the stock to 0, save the changes, and then re-enter the correct stock quantity and update the product again. This process successfully triggers the notification email to customers on the waitlist for that product. You can see this workflow in “Screenshot 2025-01-27 203324.”

    Could you please confirm if there is a way to ensure the notification emails are triggered when stock is updated using the WPSheet plugin? Any guidance on automating this process or fixing the issue would be greatly appreciated.

    Attachments:
    You must be logged in to view attached files.
    #633455

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    add_action(
    	'vg_sheet_editor/save_rows/after_saving_cell',
    	function ( $post_type, $post_id, $key, $new_value, $cell_args, $spreadsheet_columns, $item ) {
    		if ( woodmart_get_opt( 'waitlist_enabled' ) && 'product' === $post_type && '_stock_status' === $key && 'instock' === $new_value ) {
    			$db_storage = XTS\Modules\Waitlist\DB_Storage::get_instance();
    			$product    = wc_get_product( $post_id );
    
    			$waitlists       = $db_storage->get_subscriptions_by_product( $product );
    			$waitlists       = apply_filters( 'woodmart_waitlists_instock_list', $waitlists, $post_id );
    			$waitlists_chunk = array_chunk( $waitlists, apply_filters( 'woodmart_waitlist_scheduled_email_chunk', 50 ) );
    			$schedule_time   = time();
    
    			foreach ( $waitlists_chunk as $waitlist_chunk ) {
    				wp_schedule_single_event(
    					$schedule_time,
    					'woodmart_waitlist_send_in_stock',
    					array( $waitlist_chunk )
    				);
    
    				$schedule_time += apply_filters( 'woodmart_waitlist_schedule_time', intval( woodmart_get_opt( 'waitlist_wait_interval', HOUR_IN_SECONDS ) ) );
    			}
    		}
    	},
    	10,
    	7
    );

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)