This code 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
- 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.
Reviews