Skip to main content

Updating Special Messages for Specific Stores (Single Language)

Simple example for a single location or language to add a special message to a specific store.

Updated today

Updating Special Messages for Specific Stores

RP Promap Help Series


Overview

This guide explains how to update special messages for specific stores in your store locator script.

You will learn how to:

  • Modify day-specific messages (e.g., appointment-only days)

  • Display dynamic notices based on the current day

  • Customize header and section labels

  • Support any language, using Spanish as the working example

This setup is commonly used when different store locations require custom messaging rules.


Before You Start

Make sure you have:

  • Access to your store locator script

  • The correct location IDs for each store

  • A clear understanding of which days require special messaging

Example location IDs:

  • Acassuso → 18535034

  • Belgrano → 18535037


Getting Each Store’s Unique Location ID

To target a specific store, you must use its location ID. The easiest way to retrieve this is through the export function.

Step 1 — Export Your Locations

  1. Go to your store locator admin

  2. Use the Export or Download option

  3. Export your locations as a spreadsheet (CSV or Excel)


Step 2 — Find the Location ID Column

Open the exported file and look for a column labeled:

  • location_id

  • id

  • or similar identifier field

Each row represents a store, and this column contains the unique ID used in the script.


Step 3 — Match the Store to Its ID

Locate the store you want to update (by name, address, or city), then copy its ID.

Example:

Store Name

City

location_id

Acassuso

BA

18535034

Belgrano

BA

18535037


Step 4 — Use the ID in Your Script

Insert the ID into your selector:

[data-location-id="18535034"]

This ensures your message updates apply only to that specific store.


Notes

  • Always copy the ID exactly (no extra spaces)

  • IDs are unique — do not reuse between stores

  • If a store is not updating, double-check the ID from the export



How It Works

Each store is targeted using its unique location ID:

[data-location-id="18535034"]

Once targeted, the script:

  1. Updates day labels

  2. Adds appointment notices

  3. Adjusts header messaging

  4. Translates locator labels


Step 1 — Update Day-Specific Messages

The script checks the text of each day and replaces it when needed.

Example (Spanish)

if (text === 'Lunes') {   td.textContent = 'Lunes (solo con turno previo)'; }

Adapt for Any Language

You can replace the message with any language:

English

'Monday (appointment only)'

French

'Lundi (sur rendez-vous uniquement)'

Portuguese

'Segunda-feira (somente com agendamento)'

Step 2 — Control When Notices Appear

The script uses JavaScript’s day system:

  • 0 = Sunday

  • 1 = Monday

  • 2 = Tuesday

  • 3 = Wednesday

  • 4 = Thursday

  • 5 = Friday

  • 6 = Saturday

Example Logic

var message = (hoy === 1 || hoy === 6)   ? '⚠️ Hoy solo con turno previo'   : '';

This shows a message on Monday and Saturday only.

Custom Examples

Only Saturday

hoy === 6

Monday + Wednesday

hoy === 1 || hoy === 3

Every Day

var message = '⚠️ Hoy solo con turno previo';

Step 3 — Update the Notice Message

Default (Spanish example):

'⚠️ Hoy solo con turno previo'

Language Variations

English⚠️ Today by appointment only

German⚠️ Heute nur mit Termin

Italian⚠️ Oggi solo su appuntamento


Step 4 — Update Header Labels

The script updates default labels after load:

labels.forEach(el => el.textContent = 'Horarios'); phones.forEach(el => el.textContent = 'Teléfono'); distances.forEach(el => el.textContent = 'Distancia');

Example (English)

'Hours' 'Phone' 'Distance'

Best Practice — Support Any Language

To make your script scalable, centralize all text values.

Recommended Structure

var localeText = {   monday: 'Lunes',   saturday: 'Sábado',   mondayAppointment: 'Lunes (solo con turno previo)',   saturdayAppointment: 'Sábado (solo con turno previo)',   todayNotice: '⚠️ Hoy solo con turno previo',   hours: 'Horarios',   phone: 'Teléfono',   distance: 'Distancia' };

Why This Matters

  • Easier translation

  • Consistent messaging

  • Faster updates

  • Supports multiple regions


Multilingual Notes

1. Avoid Hardcoded Language Assumptions

The script currently checks exact values like Lunes and Sábado.

If the site language changes, these conditions may fail.


2. Handle Accents and Variations

Example already supported:

'Sabado' || 'Sábado'

Always account for:

  • accents

  • casing differences

  • encoding issues


3. Separate Logic from Language

Best structure:

  • Logic = when message shows

  • Language = what message says


Example Use Cases

Use this setup when:

  • Stores operate by appointment on certain days

  • Different regions require different languages

  • Certain locations need special notices

  • You want dynamic, day-based messaging


Copy Script (Single Location, Single Language Template)

Below is a stripped-down version designed for:

  • one store only

  • one language only

  • simple day-based appointment messaging

  • easy copy/paste implementation

This version uses Spanish as the example language and supports a single location ID.

<script> (function () {   try {     var LOCATION_ID = '18535034';      function updateDayText(store) {       store.querySelectorAll('td.oh-item').forEach(function (cell) {         var text = cell.textContent.trim();          if (text === 'Lunes') {           cell.textContent = 'Lunes (solo con turno previo)';         } else if (text === 'Sabado' || text === 'Sábado') {           cell.textContent = 'Sábado (solo con turno previo)';         }       });     }      function updateNotice(store) {       var today = new Date().getDay();       var message = (today === 1 || today === 6)         ? '⚠️ Hoy solo con turno previo'         : '';        var notice = store.querySelector('.rp-appointment-notice');       if (!notice) {         notice = document.createElement('div');         notice.className = 'rp-appointment-notice';         notice.style.cssText = 'color:#b00;font-weight:bold;font-size:13px;margin-top:4px;';          var status = store.querySelector('.maximize-oh-status');         if (status && status.parentNode) {           status.parentNode.insertBefore(notice, status.nextSibling);         }       }        notice.textContent = message;        var header = store.querySelector('.scasl-operating-hours-label');       if (header) {         var headerNotice = header.querySelector('.rp-appointment-notice-header');         if (!headerNotice) {           headerNotice = document.createElement('div');           headerNotice.className = 'rp-appointment-notice-header';           headerNotice.style.cssText = 'color:#b00;font-weight:bold;font-size:12px;margin-top:2px;';           header.appendChild(headerNotice);         }          headerNotice.textContent = message;       }     }      function updateLabels() {       document.querySelectorAll('#scasl-operating-hours-label').forEach(function (el) {         el.textContent = 'Horarios';       });        document.querySelectorAll('#scasl-phone-label').forEach(function (el) {         el.textContent = 'Teléfono';       });        document.querySelectorAll('#scasl-distance-label').forEach(function (el) {         el.textContent = 'Distancia';       });     }      function applyUpdates() {       var store = document.querySelector('[data-location-id="' + LOCATION_ID + '"]');       if (!store) return;        updateDayText(store);       updateNotice(store);       updateLabels();     }      function debounce(fn, delay) {       var timeout;       return function () {         clearTimeout(timeout);         timeout = setTimeout(fn, delay);       };     }      function limitedRetry(fn, interval, maxAttempts) {       var attempts = 0;       var timer = setInterval(function () {         attempts += 1;         fn();         if (attempts >= maxAttempts) {           clearInterval(timer);         }       }, interval);     }      var debouncedApply = debounce(applyUpdates, 300);      function startObserver() {       var observer = new MutationObserver(function (mutations) {         var shouldRun = mutations.some(function (mutation) {           return mutation.addedNodes.length > 0 || mutation.removedNodes.length > 0;         });          if (shouldRun) {           debouncedApply();         }       });        observer.observe(document.body, {         childList: true,         subtree: true       });     }      window.addEventListener('load', function () {       applyUpdates();       limitedRetry(applyUpdates, 1000, 5);       startObserver();     });   } catch (error) {     console.warn('RP store locator customization error:', error);   } })(); </script>

What to Edit

Only update these parts:

  • LOCATION_ID → set this to the correct store ID

  • 'Lunes (solo con turno previo)' → adjust Monday text if needed

  • 'Sábado (solo con turno previo)' → adjust Saturday text if needed

  • '⚠️ Hoy solo con turno previo' → change the notice message if needed

  • today === 1 || today === 6 → change which days should show the notice


Best Use Case

Use this version when:

  • you only need one store customized

  • you only need one language

  • you want the simplest possible script to maintain


Optional Simplification

If your locator content is fully static and does not reload dynamically, you may remove:

  • limitedRetry(...)

  • MutationObserver

  • debounce(...)

Keep them in place if your locator content loads or refreshes after the page first renders.


Common Mistakes

1. Wrong Location ID

  • Using an incorrect or outdated ID will prevent the script from applying

  • Always verify IDs using the export file


2. Using Staging vs Live Data

  • IDs may differ between staging and production environments

  • Make sure you are using IDs from the live environment if testing on the live site


3. Text Matching Fails

  • Exact matches like Lunes or Sábado may fail if:

    • accents differ

    • casing is different

    • the platform outputs a different language


4. Script Runs Too Early

  • If elements are not loaded yet, the script won’t find them

  • Ensure it runs after page load or uses a retry/observer method


5. Multiple Scripts Overwriting Each Other

  • Another script may overwrite your text changes

  • Check for duplicate custom scripts or theme conflicts


6. Not Updating All Message Locations

  • Some messages appear in multiple places (header + body)

  • Make sure all instances are updated for consistency


Troubleshooting

If changes do not appear:

  • Confirm the correct data-location-id

  • Check that day text matches exactly

  • Verify JavaScript day values (0–6)

  • Ensure script runs after page load

  • Look for console errors


Quick Checklist

Before publishing:

  • Correct store IDs

  • Correct day logic

  • Correct language text

  • Labels updated

  • Accents handled

  • Notice appears in both header and body


Summary

This setup allows you to:

  • Customize messaging per store

  • Control visibility by day

  • Translate locator content

  • Scale across multiple languages

Spanish is used as the example, but this system is fully adaptable to any language or region.


© Rose Perl Technology

Did this answer your question?