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

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.