Configure Product Set updates to happen between specific times

Here's how to force your Products Sets to update between specific times. For example, if you only want your Product Sets to update in the middle of the night, you can use this code to control when your Product Sets should update.

Note that this doesn't stop a Product Set from updating outside of the configured hours if it's already running. Therefore, if you configure your Product Sets to only update until 6:00am and a Product Set begins updating at 5:58am, the Product Set will continue updating until it is finished updating despite the time being past 6:00am.

1

Create a custom plugin

If you haven't done so already, create a custom plugin.

2

Add custom code

Add the following custom code to your custom plugin:

3

Edit the "from" and "to" times

In the code above (lines #11 & #12), change the $from and $to times to match the times in which you want Product Sets to update.

$from is when Product Set updates can begin running. $to is when updates should stop running after.

4

Save

Save your custom plugin file.

The changes will take place after each Product Set performs its next update.

Still need help? Contact Us Contact Us