Skip to main content

RP ProMap: Remove duplicate search radius options

Patch fix for Promap running older versions

RP ProMap: Remove duplicate search radius options

If the Search Radius menu repeats its choices, such as 10, 20, 30, 40, No Limit twice, the locator may have initialized more than once. The following temporary JavaScript patch removes repeated options from the displayed menu while you investigate the loading setup

.

Before you start

Check whether you have enabled the RP ProMap app embed or app block and still have a legacy Store Locator script installed in the theme. If both methods load the locator on the same page, remove the extra loading method when you can. This patch only corrects the menu display; it does not stop duplicate map initialization, event handlers, or API requests.

Add the temporary patch

  1. In Shopify, go to Online Store → Themes and duplicate your live theme as a backup.

  2. Open Customize for the theme, navigate to your store locator page, and add a Custom liquid section or block that runs on that page. Alternatively, use Edit code and place the script near the end of the relevant locator template, section, or theme layout. Avoid adding the same patch in both places.

  3. Paste the entire snippet below, including the <script> tags, then save. If using a JavaScript-only custom code field, paste only the code between the tags.

  4. Reload the locator page and inspect the Search Radius menu.

<script> (function () {   if (window.SCASL_RADIUS_DEDUP_PATCH) return;   window.SCASL_RADIUS_DEDUP_PATCH = true;    function removeDuplicates() {     document.querySelectorAll('select#scasl-radius-container').forEach(function (select) {       var seen = new Set();       Array.from(select.options).forEach(function (option) {         if (seen.has(option.value)) {           option.remove();         } else {           seen.add(option.value);         }       });     });   }    function start() {     removeDuplicates();      // Catch options added after the page becomes ready.     var observer = new MutationObserver(removeDuplicates);     observer.observe(document.body, { childList: true, subtree: true });      // Keep the workaround bounded to the locator startup period.     setTimeout(function () {       removeDuplicates();       observer.disconnect();     }, 15000);   }    if (document.readyState === 'loading') {     document.addEventListener('DOMContentLoaded', start, { once: true });   } else {     start();   } })(); </script>

Check the result

After a fresh page load, each configured distance and No Limit should appear once. Change the search radius and confirm the locator still updates as expected. Test a narrow screen if your theme uses a different mobile layout.

If options still repeat, inspect the dropdown in your browser’s developer tools. This snippet targets <select id="scasl-radius-container">. If your version has a different element or renders a custom menu, the selector needs to match that markup. A duplication that starts more than 15 seconds after page load also requires a longer observation window or a fix in the app.

Remove the underlying duplicate load

Look for an enabled RP ProMap app embed or block alongside legacy theme code or a legacy ScriptTag. A theme copy can also contain more than one legacy include. Keep one intended loading path for each locator instance, then remove this temporary patch once the menu remains correct without it.

For a code-level fix, clear the radius select before repopulating it and guard the locator startup so the same container cannot initialize twice. Share the repeating option order and the page URL with support if you need help tracing the duplicate include.

Did this answer your question?