Answers.Body: <p>So if you have a variant attribute that is really a determining part of what the SKU actually is, you should probably consider use a dynamic title to build the variant title.</p>
  
  <p>You can do this in the Product Type settings for that product type.  You do this by specifying a twig mini-template - here's an example:</p>
  
  <p><a href="https://i.sstatic.net/6AyCu.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6AyCu.png" alt="enter image description here"></a></p>
  
  <p>There is also a twig mini template option for the variant's <code>description</code> to be built dynamically, and this is in fact what is shown for the line item in the order details in the control panel.  Here's another example:</p>
  
  <p><a href="https://i.sstatic.net/g7Dal.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/g7Dal.png" alt="enter image description here"></a></p>
  
  <p>This surfaces the information quite nicely:</p>
  
  <p><a href="https://i.sstatic.net/KPbbm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KPbbm.png" alt="enter image description here"></a></p>
  
  <p>In this case - the left side of the hyphen is the product's title, and to the right is the variant's title, which has been build dynamically from the <code>paperSize</code> attribute of the variant.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-21T01:26:23.300Z
Answers.LastActivityDate: 2020-05-22T06:20:30.160Z
Answers.LastEditDate: 2020-05-22T06:20:30.160Z
Answers.UserDisplayName: Jeremy Daalder
Body: <p>We have products with multiple variants (varHeight). The variant information get passed to the cart successfully and order emails. However, they don't show up on the control panel. How can I get the variant information to show up on the order?</p>
  
  <p>Product page</p>
  
  <pre><code>&lt;select name="purchasableId"&gt;
  &lt;option value=""&gt;Select Height&lt;/option&gt;
  {% for purchasable in product.variants %}
  &lt;option {% if purchasable.stock &lt;= 0 and purchasable.hasUnlimitedStock == false %}disabled {% endif %} 
  value="{{ purchasable.id }}"&gt;{{ purchasable.varHeight }} - {{ purchasable.price|commerceCurrency(cart.currency) }}&lt;/option&gt;
    {% endfor %}
  &lt;/select&gt;
  </code></pre>
  
  <p>Cart page:</p>
  
  <pre><code>  {% if item.purchasable.product.type.hasVariants %}
        {% switch item.purchasable.product.type %}
          {% case "wallpaper" %}
              &lt;strong&gt;{{ item.description }}&lt;/strong&gt;&lt;br&gt;
              Height: {{ item.purchasable.varHeight }}
      {% endswitch %}
      {% else %}
          {#  Non variant purchasable  #}
          &lt;strong&gt;{{ item.description }}&lt;/strong&gt;
      {% endif %}
  </code></pre>
  
Tags: <plugin-craftcommerce><plugin-craftcommerce3>
Title: Passing variant info
ThreadText: # Passing variant info
  
  (Asked by: username_0 on 2020-04-29)
  
  We have products with multiple variants (varHeight). The variant information get passed to the cart successfully and order emails. However, they don't show up on the control panel. How can I get the variant information to show up on the order?
  
  Product page
  
  ```
  <select name="purchasableId">
  <option value="">Select Height</option>
  {% for purchasable in product.variants %}
  <option {% if purchasable.stock <= 0 and purchasable.hasUnlimitedStock == false %}disabled {% endif %} 
  value="{{ purchasable.id }}">{{ purchasable.varHeight }} - {{ purchasable.price|commerceCurrency(cart.currency) }}</option>
    {% endfor %}
  </select>
  
  ```
  
  Cart page:
  
  ```
    {% if item.purchasable.product.type.hasVariants %}
        {% switch item.purchasable.product.type %}
          {% case "wallpaper" %}
              <strong>{{ item.description }}</strong><br>
              Height: {{ item.purchasable.varHeight }}
      {% endswitch %}
      {% else %}
          {#  Non variant purchasable  #}
          <strong>{{ item.description }}</strong>
      {% endif %}
  
  ```
  
  **Tags:** plugin-craftcommerce, plugin-craftcommerce3
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-05-21. Score: 1
  
  So if you have a variant attribute that is really a determining part of what the SKU actually is, you should probably consider use a dynamic title to build the variant title.
  
  You can do this in the Product Type settings for that product type. You do this by specifying a twig mini-template - here's an example:
  
  [![enter image description here](https://i.sstatic.net/6AyCu.png)](https://i.sstatic.net/6AyCu.png)
  
  There is also a twig mini template option for the variant's `description` to be built dynamically, and this is in fact what is shown for the line item in the order details in the control panel. Here's another example:
  
  [![enter image description here](https://i.sstatic.net/g7Dal.png)](https://i.sstatic.net/g7Dal.png)
  
  This surfaces the information quite nicely:
  
  [![enter image description here](https://i.sstatic.net/KPbbm.png)](https://i.sstatic.net/KPbbm.png)
  
  In this case - the left side of the hyphen is the product's title, and to the right is the variant's title, which has been build dynamically from the `paperSize` attribute of the variant.
  
  
  ---
  
  