Answers.Body: <p>You need to tell Craft to look within the Commerce section like this:</p>
  
  <pre><code>{% set entries = craft.commerce.products.address(params).order('distance').find() %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-10T04:55:59.047Z
Answers.LastActivityDate: 2016-01-10T05:38:35.013Z
Answers.LastEditDate: 2016-01-10T05:38:35.013Z
Answers.UserDisplayName: Damon
Body: <p>I have Smart Map working perfectly <em>within</em> Commerce. Meaning, I am able to show a map, etc. when I'm looking at products.</p>
  
  <p>However, I am trying to build a "product locator" to find products in my area.</p>
  
  <p>I am able to successfully pass the arguments to my results page - I can print out the zip code and distance that was chosen, but I am always getting into my "no results found" case.</p>
  
  <pre><code>{% set target = craft.request.getParam('near') %}
  {% set radius = (craft.request.getParam('radius')) craft.request.getParam('radius') : 200 %}
      {% set params = {
      'target': target,
      'range': radius
  } %}
  
  {% set entries = craft.entries.address(params).order('distance').find() %}
  </code></pre>
  
  <p><code>radius</code> is a drop-down of (miles) to choose from. 
  <code>near</code> is the name of the text input the user enters the zip.</p>
  
Tags: <plugin-smartmap>
Title: How can I tell Smart Map to look at Commerce for entries?
ThreadText: # How can I tell Smart Map to look at Commerce for entries?
  
  (Asked by: username_0 on 2016-01-10)
  
  I have Smart Map working perfectly *within* Commerce. Meaning, I am able to show a map, etc. when I'm looking at products.
  
  However, I am trying to build a "product locator" to find products in my area.
  
  I am able to successfully pass the arguments to my results page - I can print out the zip code and distance that was chosen, but I am always getting into my "no results found" case.
  
  ```
  {% set target = craft.request.getParam('near') %}
  {% set radius = (craft.request.getParam('radius')) craft.request.getParam('radius') : 200 %}
      {% set params = {
      'target': target,
      'range': radius
  } %}
  
  {% set entries = craft.entries.address(params).order('distance').find() %}
  
  ```
  
  `radius` is a drop-down of (miles) to choose from.
  `near` is the name of the text input the user enters the zip.
  
  **Tags:** plugin-smartmap
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-01-10. Score: 2 | Accepted answer
  
  You need to tell Craft to look within the Commerce section like this:
  
  ```
  {% set entries = craft.commerce.products.address(params).order('distance').find() %}
  
  ```
  
  
  ---
  
  