Store Locator Code

Topic summary

A developer is building a custom store locator for a Shopify client without using an app, preferring a code-only solution. They’ve created a Liquid template with a two-column layout featuring an image and dealer information organized by province and city.

Current Issue:
The cities and dealers are not displaying despite the code structure being in place. The template uses JSON-formatted data within blocks to store dealer information by location.

Technical Setup:

  • Uses Liquid, HTML, CSS for a Shopify theme
  • Implements a schema with province blocks containing city_data in JSON format
  • Includes image picker and customizable heading
  • Has preset examples for Metro Manila and Cebu with sample dealers

Status:
The discussion remains open with no solution provided yet. The original poster is offering $12 for working code and guidance, acknowledging their beginner status and requesting assistance.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Hello, good morning!

I need to create a store locator for my client, I have told her that we may need to use an app for it. However, I really wanted to do it without an app, just codes.

I have tried doing it, and so far this is what I have

{% comment %}
  Dealer Locator - Two Column Layout with Image
{% endcomment %}

  

    
    

      {% if section.settings.dealer_image %}
        {{ section.settings.dealer_image | image_url: width: 800 | image_tag: 
          alt: section.settings.image_alt_text,
          class: "dealer-image"
        }}
      {% endif %}
    

    
    
      ## {{ section.settings.heading | default: 'Dealer Locator' }}

      
        
        

        
        

        
        

        BACK TO HOMEPAGE
      

    

  

{% schema %}
{
  "name": "Dealer Locator",
  "settings": [
    {
      "type": "image_picker",
      "id": "dealer_image",
      "label": "Dealer Image"
    },
    {
      "type": "text",
      "id": "image_alt_text",
      "label": "Image Alt Text",
      "default": "Dealer Location Map"
    },
    {
      "type": "text",
      "id": "heading",
      "label": "Section Heading",
      "default": "Dealer Locator"
    }
  ],
  "blocks": [
    {
      "type": "province",
      "name": "Province",
      "settings": [
        {
          "type": "text",
          "id": "province_name",
          "label": "Province Name"
        },
        {
          "type": "textarea",
          "id": "city_data",
          "label": "City & Dealer Data (JSON Format)",
          "default": "{ \"City Name\": [\"Dealer 1\", \"Dealer 2\"] }"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "Dealer Locator",
      "blocks": [
        {
          "type": "province",
          "settings": {
            "province_name": "Metro Manila",
            "city_data": "{ \"Makati\": [\"Dealer 1\", \"Dealer 2\"], \"Quezon City\": [\"Dealer 3\"] }"
          }
        },
        {
          "type": "province",
          "settings": {
            "province_name": "Cebu",
            "city_data": "{ \"Cebu City\": [\"Dealer 4\", \"Dealer 5\"] }"
          }
        }
      ]
    }
  ]
}
{% endschema %}

This is the current look, however the cities & dealers are not showing up

This may be something complex, hence I’m willing to pay $12 for it if your code would work and be able to guide me how to fix it. $12 may not be much, but it’s already one day minimum wage from where I’m from.

I’m still a beginner, please assist.

Thank you!

1 Like

Sorry I posted in the wrong thread and I’m unable to delete this comment, hence I’m leaving this message. Best of luck with solving your problem!