Share This Post

I have been researching and testing methods of ending a sale in Woocommerce on a specific day – whether you set the date of the sale ON the LAST DAY of the sale or on the NEXT DAY of the sale.

The assumption is that if you have set your Timezone in WordPress to your correct timezone (US – Central here) then the sale would end at Midnight of the last day. So if my sale ends on 1/24/2020 then I would set the sale date to end ON 1/24/2020 and when Midnight hit, the sale would end. I have not seen this to be the case though. I have seen mixed results of this, and WizzyWigWebDesign has also seen mixed results in their testing.

Here is what I’ve tested and recommend to fix the Woocommerce sales dates:

  1. Add your sale prices to the items
  2. Add your sales dates starting and ending on the days of your sale Рneeded because the values needed are not generated until these are added
  3. Search in phpMyAdmin > wp_postmeta using the WordPress post_id generated for your product
  4. Find the Meta Value for the sale in “_sale_price_dates_from” & “_sale_price_dates_to”
  5. Generate new timestamps for the exact times you want the sale to start and end > TimeStampConvert.com
  6. Replace the values for those items using the below Update command
  7. Simulate query first – check that the number of lines to be updated is the same as the
  8. Hit Go if the number is correct

SQL Command to update timestamps for Woocommerce sales:
UPDATE 'wp_postmeta' SET 'meta_value' = **NEW TIMESTAMP##** WHERE 'wp_postmeta'.'meta_value' = **OLD TIMESTAMP##**;

Example of completed command:

UPDATE 'wp_postmeta' SET 'meta_value' = 1573106459 WHERE 'wp_postmeta'.'meta_value' = 1573106400;

Share This Post