Answers.Body: <p>This line is incomplete:</p>
  
  <pre><code>{% set order = craft.commerce
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-19T15:48:29.733Z
Answers.LastActivityDate: 2019-03-19T15:48:29.733Z
Answers.UserDisplayName: Clive Portman
Body: <pre><code>Internal Server Error
  Unexpected token "name" of value "name" ("end of statement block" expected).
  </code></pre>
  
  <p>Getting this error on my commerce/products template.  What am I missing?</p>
  
  <pre><code>{% extends 'shop/_layouts/main' %}
  {% block main %}
  
  {% for product in craft.commerce.products.limit(5).find() %}
      &lt;div class="row product"&gt;
          &lt;div class="two columns"&gt;
            {% include "shop/_images/product" with { class: 'u-max-full-width' } %}
  
          &lt;/div&gt;
          &lt;div class="ten columns"&gt;
              &lt;h5&gt;{% if product.url %}{{ product.link }}{% else %}{{ product.title }}{% endif %}&lt;/h5&gt;
  
  
              {% if product.variants|length %}
                  &lt;form method="POST"&gt;
                      &lt;input type="hidden" name="action" value="commerce/cart/updateCart"&gt;
                      &lt;input type="hidden" name="redirect" value="shop/cart"&gt;
                      &lt;input type="hidden" name="qty" value="1"&gt;
                      {{ getCsrfInput() }}
  
                      &lt;select name="purchasableId" class="purchasableId"&gt;
                          {%- for purchasable in product.variants -%}
                              &lt;option {% if purchasable.stock &lt;= 0 and purchasable.unlimitedStock == false %}disabled {% endif %}
                                      data-info="product-{{ product.id }}-purchasable-{{ purchasable.id }}"
                                      value="{{ purchasable.purchasableId }}"&gt;
                                      {{ purchasable.description }} {{ purchasable.salePrice|commerceCurrency(cart.currency) }}
                              &lt;/option&gt;
                          {%- endfor -%}
                      &lt;/select&gt;
  
                      {% if product.unlimitedStock or (product.unlimitedStock == false and product.totalStock &gt; 0 ) %}
                    &lt;button type="submit"&gt;{{ "Add to cart"|t }}&lt;/button&gt;
                      {% else %}
                          {{ "Out of Stock"|t }}
                      {% endif %}
                  &lt;/form&gt;
  
                  {% if currentUser %}
                  {% set order = craft.commerce
                  &lt;select name="options[giftWrapped]"&gt;
                    &lt;option value="no"&gt;No gift wrap.&lt;/option&gt;
                    &lt;option value="yes"&gt;Gift wrapped.&lt;/option&gt;
                  &lt;/select&gt;
            .orders.user(currentUser).hasPurchasables(product.defaultVariant).find() %}
            {% if order|length %} &lt;strong&gt;I already own this product: &lt;/strong&gt; &lt;a href="customer/order?orderNumber={{ order[0].number }}"&gt;Order #{{ order[0].shortNumber }}&lt;/a&gt;
                  {% endif %}
                  {% endif %}
  
                  {%- for purchasable in product.variants -%}
                      &lt;div id="product-{{ product.id }}-purchasable-{{ purchasable.id }}" class="purchasableInfo" style="display:none;"&gt;
                          &lt;strong&gt;Regular Price: &lt;/strong&gt;&lt;strike&gt;{{ purchasable.price|commerceCurrency(cart.currency) }}&lt;/strike&gt;&lt;br&gt;
                          &lt;strong&gt;Now: &lt;/strong&gt;{{ purchasable.salePrice|commerceCurrency(cart.currency) }}&lt;br&gt;
                          {% if purchasable.salesApplied %}&lt;strong&gt;Sales Applied:&lt;/strong&gt;&lt;br&gt;{% endif %}
                          &lt;ul&gt;
                              {% for sale in purchasable.salesApplied  %}
                              &lt;li&gt;&lt;strong&gt;{{ sale.name }}&lt;/strong&gt; {{ sale.description }}&lt;/li&gt;
                              {% endfor %}
                          &lt;/ul&gt;
                      &lt;/div&gt;
                  {%- endfor -%}
  
              {% endif %}
          &lt;/div&gt;
      &lt;/div&gt;
  {% endfor %}
  {% includejs %}
      $( ".purchasableId" ).change(function(e) {
          $(".purchasableInfo").hide();
          $("#"+($(this).find(":selected").data('info'))).toggle();
      });
  {% endincludejs %}
  {% endblock %}
  </code></pre>
  
Tags: <plugin-craftcommerce><ecommerce>
Title: Unexpected token "name" of value "name" ("end of statement block" expected)
ThreadText: # Unexpected token "name" of value "name" ("end of statement block" expected)
  
  (Asked by: username_0 on 2019-03-19)
  
  ```
  Internal Server Error
  Unexpected token "name" of value "name" ("end of statement block" expected).
  
  ```
  
  Getting this error on my commerce/products template. What am I missing?
  
  ```
  {% extends 'shop/_layouts/main' %}
  {% block main %}
  
  {% for product in craft.commerce.products.limit(5).find() %}
      <div class="row product">
          <div class="two columns">
            {% include "shop/_images/product" with { class: 'u-max-full-width' } %}
  
          </div>
          <div class="ten columns">
              <h5>{% if product.url %}{{ product.link }}{% else %}{{ product.title }}{% endif %}</h5>
  
              {% if product.variants|length %}
                  <form method="POST">
                      <input type="hidden" name="action" value="commerce/cart/updateCart">
                      <input type="hidden" name="redirect" value="shop/cart">
                      <input type="hidden" name="qty" value="1">
                      {{ getCsrfInput() }}
  
                      <select name="purchasableId" class="purchasableId">
                          {%- for purchasable in product.variants -%}
                              <option {% if purchasable.stock <= 0 and purchasable.unlimitedStock == false %}disabled {% endif %}
                                      data-info="product-{{ product.id }}-purchasable-{{ purchasable.id }}"
                                      value="{{ purchasable.purchasableId }}">
                                      {{ purchasable.description }} {{ purchasable.salePrice|commerceCurrency(cart.currency) }}
                              </option>
                          {%- endfor -%}
                      </select>
  
                      {% if product.unlimitedStock or (product.unlimitedStock == false and product.totalStock > 0 ) %}
                    <button type="submit">{{ "Add to cart"|t }}</button>
                      {% else %}
                          {{ "Out of Stock"|t }}
                      {% endif %}
                  </form>
  
                  {% if currentUser %}
                  {% set order = craft.commerce
                  <select name="options[giftWrapped]">
                    <option value="no">No gift wrap.</option>
                    <option value="yes">Gift wrapped.</option>
                  </select>
            .orders.user(currentUser).hasPurchasables(product.defaultVariant).find() %}
            {% if order|length %} <strong>I already own this product: </strong> <a href="customer/order?orderNumber={{ order[0].number }}">Order #{{ order[0].shortNumber }}</a>
                  {% endif %}
                  {% endif %}
  
                  {%- for purchasable in product.variants -%}
                      <div id="product-{{ product.id }}-purchasable-{{ purchasable.id }}" class="purchasableInfo" style="display:none;">
                          <strong>Regular Price: </strong><strike>{{ purchasable.price|commerceCurrency(cart.currency) }}</strike><br>
                          <strong>Now: </strong>{{ purchasable.salePrice|commerceCurrency(cart.currency) }}<br>
                          {% if purchasable.salesApplied %}<strong>Sales Applied:</strong><br>{% endif %}
                          <ul>
                              {% for sale in purchasable.salesApplied  %}
                              <li><strong>{{ sale.name }}</strong> {{ sale.description }}</li>
                              {% endfor %}
                          </ul>
                      </div>
                  {%- endfor -%}
  
              {% endif %}
          </div>
      </div>
  {% endfor %}
  {% includejs %}
      $( ".purchasableId" ).change(function(e) {
          $(".purchasableInfo").hide();
          $("#"+($(this).find(":selected").data('info'))).toggle();
      });
  {% endincludejs %}
  {% endblock %}
  
  ```
  
  **Tags:** plugin-craftcommerce, ecommerce
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-03-19. Score: 1
  
  This line is incomplete:
  
  ```
  {% set order = craft.commerce
  
  ```
  
  
  ---
  
  