We have been asked to add a functionality that shows an active countdown with a You have %h %min %sec to catch our same day delivery offer message on a product view page, whereas the countdown is based on an optionally assigned daily cutoffAt time, set for every product individually, for every day of a week independently.
Let's take a moment to think about our approach here:
- Every product and every day of a week imply Monday to Sunday _[Cutoff_At] product attributes
- Product attributes imply setup script
- Active countdown implies JS components
We start by bumping up the setup_version value of our <MODULE_DIR>/etc/module.xml file from 1.0.0 to 1.0.1. This allows us to introduce the <MODULE_DIR>/Setup/UpgradeData.php file with an upgrade, as follows:
protected function upgradeToVersionOneZeroOne(