• Resolved dr3wsephs

    (@dr3wsephs)


    WooCommerce Schedule Sale

    Is anyone having issues with this? This is the second time someone brought this to my attention. It seems that when you are scheduling a product to go on sale using the schedule in the product page, it’s not putting the product on sale when the day arrives; it seems to make the system put the “Sale” badge or “% off” badge on the product, strikes out the original price, but display the sale price as the original one still.

    For example: We set the sale of the product to go on sale today, Dec 1st 2023 2 days ago. Today came, the product went on “sale” but isn’t the sale price isn’t there. However, when you switch the date to the previous date, so Nov 30th 2023, save the product, then it works. Anyone come in contact with this bug?

    I’ve checked the WP CRON for wc schedule sale… it runs. But for some reason, it doesn’t want to replace the original price with the sale price that was set.

Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter dr3wsephs

    (@dr3wsephs)

    Thread Starter dr3wsephs

    (@dr3wsephs)

    Agree @bssa.

    Please fix this Bug. This should not be happening especially with the holiday season in full swing when people want to set up sales.

    • Latest Woo
    • Latest WordPress
    • PHP 8.2
    • Theme: Storefront
    • Clean Active Plugins
    `
    ### wp-core ###
    
    version: 6.4.1
    site_language: en_US
    user_language: en_US
    timezone: +00:00
    permalink: /%postname%/
    https_status: false
    multisite: false
    user_registration: 0
    blog_public: 1
    default_comment_status: open
    environment_type: production
    user_count: 1
    dotorg_communication: true
    
    ### wp-paths-sizes ###
    
    wordpress_path: /home/customer/www/drewp16.sg-host.com/public_html
    wordpress_size: 54.11 MB (56743594 bytes)
    uploads_path: /home/customer/www/drewp16.sg-host.com/public_html/wp-content/uploads
    uploads_size: 17.92 MB (18794925 bytes)
    themes_path: /home/customer/www/drewp16.sg-host.com/public_html/wp-content/themes
    themes_size: 39.07 MB (40963307 bytes)
    plugins_path: /home/customer/www/drewp16.sg-host.com/public_html/wp-content/plugins
    plugins_size: 114.13 MB (119672404 bytes)
    database_size: 19.13 MB (20054016 bytes)
    total_size: 244.36 MB (256228246 bytes)
    
    ### wp-active-theme ###
    
    name: Storefront (storefront)
    version: 4.5.3
    author: Automattic
    author_website: https://woocommerce.com/
    parent_theme: none
    theme_features: core-block-patterns, widgets-block-editor, post-thumbnails, automatic-feed-links, custom-logo, menus, html5, custom-background, custom-header, site-logo, title-tag, customize-selective-refresh-widgets, wp-block-styles, align-wide, editor-styles, editor-font-sizes, editor-style, responsive-embeds, amp, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, starter-content, widgets
    theme_path: /home/customer/www/drewp16.sg-host.com/public_html/wp-content/themes/storefront
    auto_update: Disabled
    
    ### wp-themes-inactive (5) ###
    
    Astra: version: 4.5.1, author: Brainstorm Force, Auto-updates disabled
    Twenty Twenty-Four: version: 1.0, author: the WordPress team, Auto-updates disabled
    Twenty Twenty-One: version: 2.0, author: the WordPress team, Auto-updates disabled
    Twenty Twenty-Three: version: 1.3, author: the WordPress team, Auto-updates disabled
    Twenty Twenty-Two: version: 1.6, author: the WordPress team, Auto-updates disabled
    
    ### wp-plugins-active (4) ###
    
    Security Optimizer: version: 1.4.8, author: SiteGround, Auto-updates disabled
    Speed Optimizer: version: 7.4.4, author: SiteGround, Auto-updates disabled
    WooCommerce: version: 8.3.1, author: Automattic, Auto-updates disabled
    WP Crontrol: version: 1.16.1, author: John Blackbourn & crontributors, Auto-updates disabled
    
    ### wp-plugins-inactive (2) ###
    
    Elementor: version: 3.17.3, author: Elementor.com, Auto-updates disabled
    WPForms Lite: version: 1.8.4.1, author: WPForms (latest version: 1.8.5.2), Auto-updates disabled
    
    ### wp-media ###
    
    image_editor: WP_Image_Editor_GD
    imagick_module_version: Not available
    imagemagick_version: Not available
    imagick_version: Not available
    file_uploads: 1
    post_max_size: 256M
    upload_max_filesize: 256M
    max_effective_size: 256 MB
    max_file_uploads: 20
    gd_version: 2.3.3
    gd_formats: GIF, JPEG, PNG, WebP, BMP, AVIF, XPM
    ghostscript_version: 10.01.2
    
    ### wp-server ###
    
    server_architecture: Linux 5.15.126-MCIclouder399 x86_64
    httpd_software: Apache
    php_version: 8.2.13 64bit
    php_sapi: apache2handler
    max_input_variables: 3000
    time_limit: 120
    memory_limit: 768M
    max_input_time: 120
    upload_max_filesize: 256M
    php_post_max_size: 256M
    curl_version: 8.2.1 OpenSSL/3.1.1
    suhosin: false
    imagick_availability: false
    pretty_permalinks: true
    htaccess_extra_rules: true
    current: 2023-12-03T16:36:19+00:00
    utc-time: Sunday, 03-Dec-23 16:36:19 UTC
    server-time: 2023-12-03T16:36:19+00:00
    
    ### wp-database ###
    
    extension: mysqli
    server_version: 5.7.39-42-log
    client_version: mysqlnd 8.2.13
    max_allowed_packet: 33554432
    max_connections: 500
    
    ### wp-constants ###
    
    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /home/customer/www/drewp16.sg-host.com/public_html/wp-content
    WP_PLUGIN_DIR: /home/customer/www/drewp16.sg-host.com/public_html/wp-content/plugins
    WP_MEMORY_LIMIT: 256M
    WP_MAX_MEMORY_LIMIT: 768M
    WP_DEBUG: false
    WP_DEBUG_DISPLAY: true
    WP_DEBUG_LOG: false
    SCRIPT_DEBUG: false
    WP_CACHE: false
    CONCATENATE_SCRIPTS: undefined
    COMPRESS_SCRIPTS: undefined
    COMPRESS_CSS: undefined
    WP_ENVIRONMENT_TYPE: Undefined
    WP_DEVELOPMENT_MODE: undefined
    DB_CHARSET: utf8
    DB_COLLATE: undefined
    
    ### wp-filesystem ###
    
    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable
    
    
    </code></pre>
    <!-- /wp:code -->
    
    <!-- wp:paragraph -->
    <p class="">WooCommerce Status Report</p>
    <!-- /wp:paragraph -->
    
    <!-- wp:code -->
    <pre class="wp-block-code"><code>
    ### WordPress Environment ### WordPress address (URL): https://drewp16.sg-host.com Site address (URL): https://drewp16.sg-host.com WC Version: 8.3.1 REST API Version: ? 8.3.1 WC Blocks Version: ? 11.4.9 Action Scheduler Version: ? 3.6.4 Log Directory Writable: ? WP Version: 6.4.1 WP Multisite: – WP Memory Limit: 768 MB WP Debug Mode: – WP Cron: ? Language: en_US External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 8.2.13 PHP Post Max Size: 256 MB PHP Time Limit: 120 PHP Max Input Vars: 3000 cURL Version: 8.2.1 OpenSSL/3.1.1 SUHOSIN Installed: – MySQL Version: 5.7.39-42-log Max Upload Size: 256 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 8.3.1 WC Database Prefix: gks_ Total Database Size: 19.41MB Database Data Size: 17.15MB Database Index Size: 2.26MB gks_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB gks_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB gks_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gks_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gks_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_actionscheduler_actions: Data: 0.05MB + Index: 0.11MB + Engine InnoDB gks_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_actionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB gks_e_events: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_options: Data: 10.03MB + Index: 0.06MB + Engine InnoDB gks_postmeta: Data: 4.39MB + Index: 0.11MB + Engine InnoDB gks_posts: Data: 1.45MB + Index: 0.06MB + Engine InnoDB gks_presto_player_audio_presets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_presto_player_email_collection: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_presto_player_presets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_presto_player_videos: Data: 0.02MB + Index: 0.06MB + Engine InnoDB gks_presto_player_visits: Data: 0.02MB + Index: 0.08MB + Engine InnoDB gks_presto_player_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_sgs_log_events: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_sgs_log_visitors: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB gks_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB gks_wc_admin_note_actions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB gks_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gks_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_wc_orders: Data: 0.02MB + Index: 0.11MB + Engine InnoDB gks_wc_orders_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_wc_order_addresses: Data: 0.02MB + Index: 0.06MB + Engine InnoDB gks_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_wc_order_operational_data: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB gks_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB gks_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB gks_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB gks_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB gks_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB gks_wpforms_payments: Data: 0.02MB + Index: 0.14MB + Engine InnoDB gks_wpforms_payment_meta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB gks_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB ### Post Type Counts ### attachment: 83 custom_css: 1 elementor_library: 5 nav_menu_item: 6 page: 12 post: 1 product: 1 revision: 42 wp_global_styles: 1 wpforms: 2 ### Security ### Secure connection (HTTPS): ? Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates. Hide errors from visitors: ? ### Active Plugins (4) ### Speed Optimizer: by SiteGround – 7.4.4 Security Optimizer: by SiteGround – 1.4.8 WooCommerce: by Automattic – 8.3.1 WP Crontrol: by John Blackbourn & crontributors – 1.16.1 ### Inactive Plugins (2) ### Elementor: by Elementor.com – 3.17.3 WPForms Lite: by WPForms – 1.8.4.1 ### Settings ### API Enabled: – Force SSL: – Currency: CAD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – Enforce Approved Product Download Directories: ? HPOS feature screen enabled: ? HPOS feature enabled: ? Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore HPOS data sync enabled: – ### WC Pages ### Shop base: #24517 - /shop/ Cart: #24518 - /cart/ Checkout: #24519 - /checkout/ My account: #24520 - /my-account/ Terms and conditions: ? Page not set ### Theme ### Name: Storefront Version: 4.5.3 Author URL: https://woocommerce.com/ Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ? ### Templates ### Overrides: /home/customer/www/drewp16.sg-host.com/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/templates/notices/error.php /home/customer/www/drewp16.sg-host.com/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/templates/notices/notice.php /home/customer/www/drewp16.sg-host.com/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/templates/notices/success.php ### Admin ### Enabled Features: activity-panels analytics product-block-editor coupons core-profiler customer-effort-score-tracks import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing mobile-app-banner navigation onboarding onboarding-tasks product-variation-management remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page Disabled Features: customize-store minified-js new-product-management-experience product-virtual-downloadable product-external-affiliate settings async-product-editor-category-field Daily Cron: ? Next scheduled: 2023-12-03 17:06:57 +00:00 Options: ? Notes: 62 Onboarding: skipped ### Action Scheduler ### Complete: 69 Oldest: 2023-11-03 04:56:44 +0000 Newest: 2023-12-03 16:35:52 +0000 Failed: 1 Oldest: 2023-12-02 17:08:17 +0000 Newest: 2023-12-02 17:08:17 +0000 Pending: 1 Oldest: 2023-12-03 17:07:08 +0000 Newest: 2023-12-03 17:07:08 +0000 ### Status report information ### Generated at: 2023-12-03 16:39:44 +00:00 `
    • This reply was modified 11 months, 4 weeks ago by dr3wsephs.
    Thread Starter dr3wsephs

    (@dr3wsephs)

    Thank you @csa3a07 for coming forward .

    As per my discussion here: Sales price not showing | www.remarpro.com, using WooCommerce version 8.0 fixes this issue. So, somewhere between 8.1 and 8.3, this bug lives. The bug being the sale day comes, the system puts the product on sale, shows the sale badge, along with strikes out the original price… but, displays the original price again as the sale price. This, shouldn’t be happening.

    I’ve tested the latest version of Woo in my vanilla staging site and the issue is there… and there are no other plugins that are conflicting with Woo.

    In version 8.0 of Woo, the bug is not there. When I did the rollback to this version, the day of the sale came and the system put the product on sale with the sale badge, crossed out the original price… and bam: sale price is displayed correctly. The sale price displays and the original price is crossed out.

    • This reply was modified 11 months, 3 weeks ago by dr3wsephs.

    Hi @dr3wsephs

    Thanks for reaching out!

    I understand that you are experiencing issues regarding the scheduled sale price of your products wherein when the scheduled date comes, regular price is being striked, but it still displays the regular price instead of the sale price, correct?

    I replicated the scenario on my personal site, however, I am unable to reproduce the issue as you can see below:

    Product edit page:

    Single products page:

    My personal site is running on WooCommerce version 8.2.1 if it helps.

    I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:

    • System Status Report which you can find via WooCommerce > Status > Get system report > Copy for support.
    • Fatal error logs (if any) under WooCommerce > Status > Logs.

    You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.

    Once we have more information, we’ll be able to assist you further.

    Thread Starter dr3wsephs

    (@dr3wsephs)

    Hi @xue28. I did some further Testing.

    I put one staging site with WooCommerce at version 8.2.1 and another staging site at WooCommerce 8.3.1. They’re called 1 and 2 respectively for the purposes of screenshots. Both sites are using Storefront theme and have only WooCommerce active; just so we can actually prove that no other plugins are active that may conflict.

    Staging 1

    Screenshot by Lightshot (prnt.sc)

    Screenshot by Lightshot (prnt.sc)

    Screenshot by Lightshot (prnt.sc)

    Screenshot by Lightshot (prnt.sc)

    Here I am showing you that my staging one (1) site is using the latest Woo version and the bug is present. Status Report: https://gist.github.com/Dr3wsephs/28567291cc8ef869284b815193a23b49

    Staging 2

    Screenshot by Lightshot (prnt.sc)

    Screenshot by Lightshot (prnt.sc)

    Screenshot by Lightshot (prnt.sc)

    Screenshot by Lightshot (prnt.sc)
    Here I am showing you that my staging two (2) site is using the WooCommerce version 8.2.1. Status Report: gist:09bc09a0b39a17ff10e51431e93a63a3 (github.com)

    So, from the looks of it, 8.2.1 is fine, 8.3.1 is not.

    Same problem like u. We checked the cron job for the sale prices – they are fine…

    We have the same issue as @dr3wsephs described. Rollback to Woocommerce 8.2.1 fixed the problem.

    We ran into the same issue (currently running  8.4.0) when we noticed scheduled sale products were not showing up on the sale page well after the schedule had passed ([sale_products] shortcode).

    Looking at the product object, we can see the issue is with the price value. Here’s an example showing the bug with a simple product with past scheduled sale price:

    WC_Product_Simple Object
    (
       ...
                [price] => 1000
                [regular_price] => 1000
                [sale_price] => 700
                [date_on_sale_from] => WC_DateTime Object
                    (
                        [utc_offset:protected] => 0
                        [date] => 2023-12-19 00:00:00.000000
                        [timezone_type] => 3
                        [timezone] => Asia/Tokyo
                    )
    
                [date_on_sale_to] => 
      ...
    )

    The price has not been updated with the sale_price value although it is well past the scheduled time. Other posts alluded to an issue with the woocommerce_scheduled_sales cron event but we confirmed the event had run on time and we manually ran the event as well.

    Diving into the DB, for the above product .._wc_product_meta_lookup table, the onsale boolean is false.

    Curiously, variable products do show correct schedule sale prices although they still suffer the same issue with not showing on our sales page and as with simple products, the .._wc_product_meta_lookup table onsale boolean is also false.

    • This reply was modified 11 months, 1 week ago by kylebarrow.
    • This reply was modified 11 months, 1 week ago by kylebarrow.
    • This reply was modified 11 months, 1 week ago by kylebarrow.

    Hey everyone.

    Thank you all for reporting the issue.

    This is a bug which we are currently working on.

    We are doing our best to fix it as soon as possible.

    We can’t specify a date when the bug will be fixed, it is still in progress. We apologize for any inconvenience this may have caused you, and we thank you for your patience.

    If anyone has any further questions, please let us know.

    Have a wonderful day!

    I ran into this issue today with the start of my sale as well. Though it has been mentioned above that the bug is known to the dev team, I thought I’d pop in to share a simple work-around that seems to be working for me.

    Running on Woocommerce 8.4.0 (latest):

    1. The sale should already be running. This probably wont make a difference if it hasn’t started yet.
    2. Delete the price from the sale price field. Leave the sale dates as they are. Click Update to publish the page.
    3. Add the discount price back to the sale price field. Click Update to publish the page.

    For me, this forced the discount price to take effect how it would normally. May be worth a shot before rolling back.

    • This reply was modified 11 months, 1 week ago by rotornut44.
    • This reply was modified 11 months, 1 week ago by rotornut44.
    Plugin Support Beauty of Code (woo-hc)

    (@beautyofcode)

    Hey @rotornut44,

    Thanks for sharing a workaround, this may be very helpful for others who are experiencing this issue and prefer to not rollback to a previous version while our dev’s look into this ??

    Cheers!

    When we were looking at a fix for products where the sale had already started, we found removing the scheduled sale start date then updating fixed the issue (sale price shown, shows on sale page) but we had well over 200 products affected by this bug (many with variations) so instead made a quick and dirty function that we could access via an ‘AJAX’ call to fix:

    function fix_past_sales()
    {
    	$is_admin = false;
    
    	// Only allow shop admins to run this
    	if (is_user_logged_in())
    	{
    		$current_user = wp_get_current_user();
    		$current_user_roles = $current_user->roles;
    		$admin_roles = array('administrator', 'editor', 'shop_manager');
    
    		foreach ($current_user_roles as $user_role) {
    			if (in_array($user_role, $admin_roles, true))
    			{
    				$is_admin = true;
    				break;
    			}
    		};
    	}
    
    	if (!$is_admin)
    	{
    		echo 'Invalid user';
    		return;
    	}
    
    	global $wpdb;
    
    	$now = new DateTime();
    
    	// Get products with a sale start in the past
    	$results = $wpdb->get_results("SELECT post_id, meta_value FROM {$wpdb->prefix}postmeta WHERE meta_key='_sale_price_dates_from' AND meta_value < {$now->getTimestamp()}", OBJECT);
    
    	echo '<pre>';
    
    	foreach($results as $result)
    	{
    		$product = wc_get_product($result->post_id);
    
    		if ($product)
    		{
    			$product_name = $product->get_name();
    			$product_sale_start = date('Y-m-d H:i:s', $result->meta_value);
    
    			// Remove the sale start
    			$product->set_date_on_sale_from('');
    			$product->save();
    
    			echo "Removed sale start date $product_sale_start from  $product_name\n";
    		}
    	}
    
    	echo '</pre>';
    }
    add_action('wc_ajax_fix_past_sales', 'fix_past_sales');

    When placed in your site theme functions.php this can be triggered by https://yoursitedomain.com/?wc-ajax=fix_past_sales

    Worked for us but was a hot fix with limited QA and so comes with the usual use at own risk warning.

    • This reply was modified 11 months, 1 week ago by kylebarrow.
    • This reply was modified 11 months, 1 week ago by kylebarrow.

    We were encountering this issue with WC 8.4.0. Even running cron manually wasn’t updating the prices.

    Updated to 8.5.2, manually triggered the cron event via Crontrol plugin and the sale prices updated.

    Appears to be fixed in 8.5.2.

    • This reply was modified 9 months, 2 weeks ago by websavers.
    sannadigital

    (@sannadigital)

    We have encountered this issue in woocommerce 8.8.2. No way to fix it until now.

    Hey, @sannadigital!

    The issue mentioned on this thread was already merged on a past version, so we need to investigate what is going on on your website.

    Per WordPress forum guidelines, would you mind opening up a new thread for this so that we can keep things organized and offer more personalized support for you?

    We’ll be happy to help you out with this over there!

Viewing 15 replies - 1 through 15 (of 22 total)
  • You must be logged in to reply to this topic.