Set Specific Products on Sale by Time and Date

The code in this download folder enables you, the storeowner, the ability to automatically schedule one or more specific products in WooCommerce for sale by :

  • Time
  • Day of week
  • Weekend
  • Weekdays

The sale price is updated for both :

  • Simple products
  • Variations products

In this example we set the product with id 111537 on sale on Monday between the times of 7am 07 00 and midnight 24 00 at a discount of 25%.

Code Installation

  1. Copy and paste the PHP code to the end of your child themes functions file or code snippets plugin.

Settings

  • Set your discount percentage rate on line 5.
  • Set the start time on line 14.
  • Set the end time on line 15.
  • Set the product id(s) on line 29, comma separated.
  • Set the day of week, weekdays, weekend on line 39.

Download Folder

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.