I am trying to display a message for the user once they begin checking out a product past a certain time (10AM).
How would I go about doing this? Is this even possible? I'm just not sure how to catch the time from the user.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityThis can be done with the Javascript Date object. It uses the browser (device) time.
Something like the following would work
<div id="divWithWarningTextId" style="display:none;">It's past 10!</div>
<script type="text/javascript">
var time = new Date();
if (time.getHours() >= 22) {
document.getElementById('divWithWarningTextId').style.display = 'block';
}
</script>