Home / Forums / WoodMart support forum / Wishlist sending onsale email when price change to regular
Home › Forums › WoodMart support forum › Wishlist sending onsale email when price change to regular
Wishlist sending onsale email when price change to regular
- This topic has 5 replies, 2 voices, and was last updated 1 month, 3 weeks ago by
Artem Temos.
-
AuthorPosts
-
August 26, 2025 at 9:23 am #682032
metuzaParticipantHello,
I have noticed that now and then when i update product prices from saleprice to regular price i do receive the email telling me that a product now is for sale in my wishlist. Since this happens only now and then i have not done anything with it.
Today i received an forwarded email from a customer showing me that she had received the onsale email for a product that was adjusted from onsale to regular yesterday so i belive that there is a bug somewhere. But not easy to find as this happens just now and then.
I am always using the WooCommerce Advanced Bulk Edit plugin when i do these changes.
Brgds
RuneAugust 26, 2025 at 2:21 pm #682153
Artem TemosKeymasterHello,
Could you please send us your admin access and step-by-step instructions on how to reproduce this issue on your website? We don’t see any problems on our staging.
Kind Regards
August 26, 2025 at 3:27 pm #682197
metuzaParticipantHello,
I’m sorry that is the problem, it is impossible to investigate. I have maybe used the wishlist for 12-14 months and only once i have received complains from customers and that was today. And myself has received that product onsale email maybe 3 times during these months, and i usually make sure i have onsale items in my wishlist when i change to regular price just to test.
I have done lots, and lots of tests but never received the onsale email during any of my tests. When checked database today (woodmart_wishlist_products) i also find that the product the customer received email about had value 0 in the onsale column, so not on sale and all ok there.
So it is really wierd and i do not think it is a big problem as it as mentioned almost never happens. So you can do hundreds of tests and never see any problem.
I just wanted to mention it in case you had a suspicion about something in the code. I have study the code myself and can not find anything there that should be able to send the wrong email.
Brgds
RuneAugust 26, 2025 at 3:59 pm #682205
Artem TemosKeymasterTry to add the following code snippet to the
functions.php
file in your child theme. It will add extra conditions to fix such casesif ( ! function_exists( 'woodmart_cleanup_invalid_sale_products' ) ) { /** * This removes the item from the 'Wishlist on Sale' letter queue if the product is not on sale. * * @param int $user_id User ID. * @param array $product_ids Array of product IDs. */ function woodmart_cleanup_invalid_sale_products( $user_id, $product_ids ) { $products_on_sale = get_option( 'woodmart_wishlist_products_on_sale', array() ); if ( ! $products_on_sale ) { return; } foreach ( $product_ids as $product_id ) { $product = wc_get_product( $product_id ); if ( ! $product || ! $product->is_on_sale() ) { if ( isset( $products_on_sale[ $user_id ] ) ) { $key = array_search( $product_id, $products_on_sale[ $user_id ], true ); if ( false !== $key ) { unset( $products_on_sale[ $user_id ][ $key ] ); } } } } if ( isset( $products_on_sale[ $user_id ] ) ) { $products_on_sale[ $user_id ] = array_values( $products_on_sale[ $user_id ] ); if ( empty( $products_on_sale[ $user_id ] ) ) { unset( $products_on_sale[ $user_id ] ); } } update_option( 'woodmart_wishlist_products_on_sale', $products_on_sale, false ); } add_action( 'woodmart_send_on_sale_products_mail', 'woodmart_cleanup_invalid_sale_products', 5, 2 ); }
August 26, 2025 at 7:44 pm #682264
metuzaParticipantThank you 🙂 I have added it to my functions and will let you know in a year or so, or if it happens again.
Thanks again ..
Brgds
RuneAugust 27, 2025 at 9:02 am #682314
Artem TemosKeymasterOK, great. I will keep this topic open.
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register