Displaying products from a category New to Craft Commerce and doing something pretty template intensive. 

I am following this https://craftcommerce.com/support/product-taxonomy  and https://craftcommerce.com/support/products-related-to-category

My categories group handle "productCategories"
My categories field handle "whatFinish"
Categories so far are "metallic" and "standard"

This code returns a short list of both categories from the page above

{% nav category in product.productDepartments %}
  &lt;li&gt;
    &lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;
    {% ifchildren %}
      &lt;ul&gt;
        {% children %}
      &lt;/ul&gt;
    {% endifchildren %}
  &lt;/li&gt;
{% endnav %}


When I use this code with any of a variety of options to replace(category) I get a template error with a variable issue.

{# Fetch all of the products related to this category #}
{% set products = craft.commerce.products.relatedTo(category) %}

{# Output them #}
{% for product in products %}
    &lt;a href="{{ product.url }}"&gt;{{ product.title }}&lt;/a&gt;
{% endfor %}


Examples things I have tried: 

          {# Fetch all of the products related to this category #}
{% set products = craft.commerce.products.relatedTo(standard) %}

{# Output them #}
{% for product in products %}
    &lt;a href="{{ product.url }}"&gt;{{ product.title }}&lt;/a&gt;
{% endfor %}


 {# Fetch all of the products related to this category #}
{% set products = craft.commerce.products('whatFinish').relatedTo(standard) %}

{# Output them #}
{% for product in products %}
    &lt;a href="{{ product.url }}"&gt;{{ product.title }}&lt;/a&gt;
{% endfor %}

{# Fetch all of the products related to this category #}
{% set products = craft.commerce.products('standard').relatedTo(whatFinish) %}

{# Output them #}
{% for product in products %}
    &lt;a href="{{ product.url }}"&gt;{{ product.title }}&lt;/a&gt;
{% endfor %}


Before to get all of the products (not desired as I want just the ones form a specific category) my code worked fine: 

  &lt;div class="row "&gt;
{% for product in craft.commerce.products.limit(5).find() %}
&lt;div class="col-md-4 col-sm-4  col-xs-12"&gt;
    &lt;div class=" text-center"&gt;
        {% set image = product.slider.first() %} {% if image %}
        &lt;img alt="product.title" class="" src="{{ image.getUrl({ height: 250 }) }}"&gt; {% endif %}
        &lt;div class="title"&gt;
            &lt;h5 class="mb0"&gt;{% if product.url %}{{ product.link }}{% else %}{{ product.title }}{% endif %}&lt;/h5&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;!--end three col--&gt;
{% endfor %}





Do I need to bracket the category code with something I am not aware of? Sorry just completely lost here. I was directed to post form the support email. 

Steph
{% set products = craft.commerce.products.relatedTo(category) %}

...is the correct code for finding products related to a category IF category is actually a Category Model at this point - e.g. it is the auto populated category variable in a template set to the template for that category group.  I would check, in the catgeory group settings, what you're using for the Category URL formats and the Category Template settings.

It would be also very helpful to know what's the actual error you are getting?