Checkout Toolbox

Flex Theme Sections

Linear Shopping Experiences

Creating Time Based Messaging Like 'Call now, we're open' in Shopify

Many Shopify stores would like to have different messaging for different times of the days.  The most common scenario is a message for the customer to call the store when the store is open and to email when the store is closed.  Here are the instructions on how to do that in Shopify with Liquid and JS.

You've seen that useful promo on other store's that tells the customer to call when the store is open. Here's an example of the promo:

And then when the store is closed, the messaging is changed to something like this:

Well, here's the liquid code to make that happen.  This view is from within the Shopify theme editor, which does a good job of color coding elements so its easier to read.  Notes are included to help you understand how it works.

One thing to note here is that we are doing this in Liquid (we could also do it it in Javascript).  Liquid is processed on the Shopify servers and then used to render the HTML and other assets to the customer's browser.  So the time and date that you will be getting is from Shopify's servers.

Hope this helps!


JadePuma is a certified Shopify Expert. If you need any help with your Shopify store, we can help.


Search