Skip to main content

Display selected store operating hours beneath the ProMap map

Customer-specific CSS and JavaScript customization for showing the selected store’s weekly schedule below the map.

This customer-specific customization displays the selected store’s complete weekly operating hours directly beneath the ProMap map. The displayed hours automatically update when a visitor selects another store.

Before you begin

  • Confirm each location has operating hours configured in ProMap.

  • In ProMap, go to Settings → Customize the store locator’s design → Store List.

  • Under Detail Store Fields Display, make sure Operating Hours is selected.

  • Duplicate your Shopify theme before editing theme code.

Step 1: Add the CSS in ProMap

  1. Open ProMap Settings.

  2. Open the Custom CSS field.

  3. Paste the following CSS and save.

/* Selected store hours beneath the map */#scasl-customer-hours {  float: right;  clear: right;  width: 69%;  margin-top: 16px;  padding: 20px;  color: #222;  background: #fff;  border: 1px solid #ddd;  border-radius: 8px;  box-sizing: border-box;}#scasl-customer-hours[hidden] {  display: none !important;}#scasl-customer-hours .scasl-operating-hour {  display: block !important;  padding: 0;}#scasl-customer-hours .scasl-operating-hours-icon {  margin-bottom: 12px;  font-weight: 600;}#scasl-customer-hours .maximize-oh-status {  display: flex;  align-items: center;  justify-content: space-between;  margin-bottom: 12px;  cursor: pointer;}#scasl-customer-hours .maximize-oh-wrapper table {  width: 100%;  margin: 0;  border-collapse: collapse;  box-shadow: none;}#scasl-customer-hours .maximize-oh-wrapper td {  padding: 6px 12px 6px 0 !important;  border: 0;  vertical-align: top;}#scasl-customer-hours .maximize-oh-wrapper td:first-child {  width: 42%;  font-weight: 600;}#bh-sl-map-container::after {  display: table;  clear: both;  content: "";}@media screen and (max-width: 1023px) {  #scasl-customer-hours {    float: none;    clear: both;    width: 100%;  }}/* Hide only the original hours in the store list when the JS toggle is true. */#scasl-app-container.scasl-hide-original-hours .scasl-location-list .scasl-operating-hour {  display: none !important;}/* Keep the copied weekly schedule fully expanded. */#scasl-customer-hours .minimize-oh-wrapper,#scasl-customer-hours .maximize-oh-status {  display: none !important;}#scasl-customer-hours .maximize-oh-wrapper {  display: block !important;}

If you reach the Custom CSS limit

If the Custom CSS field will not let you save because the code is too long, add the CSS from Step 1 to a separate Shopify theme file instead. Shopify’s built-in Custom CSS fields allow 1,500 characters for the whole theme and 500 characters for an individual section. These are Shopify theme-editor limits, separate from ProMap’s Custom CSS field. Shopify does not provide a setting to increase them; a theme CSS file lets you add more CSS without using those fields.

  1. In Shopify admin, go to Online Store → Themes. Click the ⋯ menu beside your theme and choose Duplicate. Work on the duplicate first.

  2. On the duplicate theme, click ⋯ → Edit code.

  3. In the left sidebar, right-click the assets folder and choose New file. Name the file promap-custom.css. If it already exists, open it instead.

  4. Copy the complete CSS block from Step 1 into this file. If the file already contains CSS, add the new rules below it. Include only CSS, without <style> tags. Click Save.

  5. Open layout → theme.liquid. Find the closing </head> tag and insert the following line immediately above it. Add this line only once, then click Save.

{{ 'promap-custom.css' | asset_url | stylesheet_tag }}
  1. Continue with Step 2 below to add the JavaScript. The CSS file handles styling; the JavaScript is still required to display and update the selected store’s hours.

  2. Preview the duplicate theme and run the checks in Step 3 on desktop and mobile. If you previously added the same CSS to ProMap or a Shopify Custom CSS field, remove only that duplicate block after confirming the file works. Keep any unrelated CSS.

  3. When everything works, publish the duplicate theme. For future CSS additions, open assets → promap-custom.css, add your rules, and save.

Note: CSS in a theme file is loaded across the storefront. The Step 1 rules target ProMap elements. If you move other CSS from a section’s Custom CSS field, add a section-specific selector where needed, because the theme file does not automatically scope rules to that section. Keep a copy of the file and its stylesheet line so you can reapply them after a theme update if needed.

Step 2: Add the JavaScript to Shopify

Choose whether to hide the original hours: At the top of the script, set HIDE_ORIGINAL_HOURS = true to hide operating hours in the left store list, or set it to false to keep them visible. The selected store’s full weekly schedule appears beneath the map in both modes. This is a theme-code setting, not a visitor-facing switch. Save and reload the storefront after changing it.

If you installed the earlier version, replace both existing code blocks with the CSS in Step 1 and the JavaScript in Step 2; do not run both scripts.

Add the following code to the customer’s theme JavaScript file. Alternatively, add it to a Shopify Custom Liquid block and wrap the code with opening and closing script tags.

(() => {  // Toggle: true hides hours in the left store list; false keeps them visible.  const HIDE_ORIGINAL_HOURS = true;  const MOUNT_ID = 'scasl-customer-hours';  const HIDE_CLASS = 'scasl-hide-original-hours';  let animationFrame = 0;  let sourceHours = null;  let sourceMarkup = null;  function detailHoursEnabled() {    const fields = window.SCASLSetting && window.SCASLSetting.selected_wfields;    if (Array.isArray(fields)) {      return fields.includes('operating_hours');    }    if (typeof fields === 'string') {      return fields.split(',').map((field) => field.trim())        .includes('operating_hours');    }    return true;  }  function getMount(map) {    let mount = document.getElementById(MOUNT_ID);    if (!mount) {      mount = document.createElement('div');      mount.id = MOUNT_ID;      mount.hidden = true;    }    if (mount.previousElementSibling !== map) {      map.insertAdjacentElement('afterend', mount);    }    return mount;  }  function syncSelectedStoreHours() {    animationFrame = 0;    const app = document.getElementById('scasl-app-container');    const map = document.getElementById('bh-sl-map');    if (!app || !map) {      if (app) app.classList.remove(HIDE_CLASS);      const oldMount = document.getElementById(MOUNT_ID);      if (oldMount) oldMount.hidden = true;      sourceHours = null;      sourceMarkup = null;      return;    }    const mount = getMount(map);    const selected = app.querySelector('.scasl-location-list li.store-list-focus');    const hours = detailHoursEnabled() && selected      ? selected.querySelector('.scasl-operating-hour')      : null;    if (!hours || !hours.textContent.trim()) {      mount.replaceChildren();      mount.hidden = true;      app.classList.remove(HIDE_CLASS);      sourceHours = null;      sourceMarkup = null;      return;    }    // Copy the display; keep ProMap's original element and events in place.    const markup = hours.outerHTML;    if (sourceHours !== hours || sourceMarkup !== markup ||        !mount.firstElementChild) {      const copy = hours.cloneNode(true);      // Avoid duplicate IDs and inline ProMap click handlers in the copy.      [copy, ...copy.querySelectorAll('*')].forEach((element) => {        element.removeAttribute('id');        element.removeAttribute('for');        element.removeAttribute('aria-controls');        element.removeAttribute('aria-labelledby');        element.removeAttribute('aria-describedby');        [...element.attributes].forEach((attribute) => {          if (/^on/i.test(attribute.name)) {            element.removeAttribute(attribute.name);          }        });      });      // Render the copied weekly schedule as a static display.      copy.querySelectorAll('.maximize-oh-status, .minimize-oh-wrapper')        .forEach((element) => element.remove());      mount.replaceChildren(copy);      sourceHours = hours;      sourceMarkup = markup;    }    mount.hidden = false;    app.classList.toggle(HIDE_CLASS, HIDE_ORIGINAL_HOURS);  }  function scheduleSync() {    if (!animationFrame) {      animationFrame = window.requestAnimationFrame(syncSelectedStoreHours);    }  }  function start() {    const app = document.getElementById('scasl-app-container');    if (!app) {      window.setTimeout(start, 250);      return;    }    scheduleSync();    const observer = new MutationObserver((mutations) => {      const locatorChanged = mutations.some((mutation) => {        const target = mutation.target instanceof Element          ? mutation.target          : mutation.target.parentElement;        return target && !target.closest('#' + MOUNT_ID) &&          (target === app || target.closest('.scasl-location-list'));      });      // Ignore our own visibility-class changes to avoid a feedback loop.      if (locatorChanged && mutations.some((mutation) =>        !(mutation.target === app && mutation.type === 'attributes')      )) {        scheduleSync();      }    });    observer.observe(app, {      childList: true,      subtree: true,      characterData: true,      attributes: true,      attributeFilter: ['class', 'style', 'hidden']    });    document.addEventListener('click', (event) => {      if (event.target instanceof Element &&          event.target.closest('.scasl-location-list li[data-markerid]')) {        window.setTimeout(scheduleSync, 0);      }    });  }  if (document.readyState === 'loading') {    document.addEventListener('DOMContentLoaded', start, { once: true });  } else {    start();  }})();

Step 3: Test the customization

  1. Open the storefront’s Store Locator page.

  2. Select a store from the results list.

  3. Confirm the complete weekly schedule appears beneath the map.

  4. Select a different store and confirm the schedule updates.

  5. With HIDE_ORIGINAL_HOURS = true, confirm hours are hidden in the left store list while the selected schedule remains visible beneath the map.

  6. Change the setting to false, save, and reload. Confirm the original left-column hours and the below-map schedule are both visible.

  7. Test both desktop and mobile layouts in each mode.

  8. Confirm stores without hours do not display an empty card.

How it works

The JavaScript copies the selected location’s existing ProMap operating-hours markup beneath the map and keeps the copied weekly schedule expanded. It leaves ProMap’s original element in place so the left-column display remains available when HIDE_ORIGINAL_HOURS is false. When the setting is true, a scoped CSS rule hides the original hours in the store list while the below-map card is available. Store selection and changes to the source hours refresh the copy. No store hours are hard-coded. The script also respects the Operating Hours selection in the Design tab.

Important notes

  • This is a customer-specific theme customization, not a global ProMap setting.

  • The Display Operating Hours switch controls default-hours fallback for locations without their own schedule. It is separate from the Operating Hours field in Detail Store Fields Display.

  • If the theme or ProMap storefront markup changes, review this customization again.

  • To roll back, remove the JavaScript and the CSS block shown above. If you used the theme-file method, also remove the stylesheet line from theme.liquid and remove the customization’s CSS from promap-custom.css. Keep any unrelated CSS in that file.

Did this answer your question?