Answers.Body: <p>Not sure how you're outputting the url to the variant itself, but you can always create your own link and change the variant paramater to whatever you want.</p>
  <p>Something link this: <code>{{product.url}}?keywordyouwanttouse={{variant.purchasableId}}</code></p>
  <p>On your product page you can then check if the url has the parameter and get the data of that variant.</p>
  <p>I use the following code at the top of my product template and then use the <code>selectedVariant</code>to display sku, images, prices, ...
  Here I use the variant querystring but you can change that to whatever querystring paramater you want to use.</p>
  <pre><code>{% set variantId = craft.app.request.getQueryParam('variant') ?? false %}
  {%  if variantId %}
      {% set selectedVariant = craft.variants.id(variantId).one() %}
  {% else %}
      {% set selectedVariant = product.defaultVariant %}
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-24T14:18:55.437Z
Answers.Text: If you output `url` attribute of lineitem from cart, it links to specific variant, using keyword `variant`.
Answers.UserDisplayName: Piotr Pogorzelski
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-22T12:02:50.550Z
Answers.LastActivityDate: 2020-09-22T12:02:50.550Z
Answers.UserDisplayName: Steven Vandemoortele
Body: <p>I noticed that variants can have their own URL when i outputted URL of line item in the cart. Url looks something like that:</p>
  <pre><code>http://localhost/test/web/test-prod?variant=27
  </code></pre>
  <p>Is there any way to change <code>variant</code> keyword in URL to something else?</p>
  <p>When we want to display specific variant on product page, we need to perform specific element query based on <code>variant</code> param ourselves, yes? Because only <code>product</code> variable is injected into template.</p>
  
Tags: <ecommerce>
Title: Commerce - variant URL param
ThreadText: # Commerce - variant URL param
  
  (Asked by: username_0 on 2020-09-21)
  
  I noticed that variants can have their own URL when i outputted URL of line item in the cart. Url looks something like that:
  
  ```
  http://localhost/test/web/test-prod?variant=27
  
  ```
  
  Is there any way to change `variant` keyword in URL to something else?
  
  When we want to display specific variant on product page, we need to perform specific element query based on `variant` param ourselves, yes? Because only `product` variable is injected into template.
  
  **Tags:** ecommerce
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-09-22. Score: 1
  
  Not sure how you're outputting the url to the variant itself, but you can always create your own link and change the variant paramater to whatever you want.
  
  Something link this: `{{product.url}}?keywordyouwanttouse={{variant.purchasableId}}`
  
  On your product page you can then check if the url has the parameter and get the data of that variant.
  
  I use the following code at the top of my product template and then use the `selectedVariant`to display sku, images, prices, ...
  Here I use the variant querystring but you can change that to whatever querystring paramater you want to use.
  
  ```
  {% set variantId = craft.app.request.getQueryParam('variant') ?? false %}
  {%  if variantId %}
      {% set selectedVariant = craft.variants.id(variantId).one() %}
  {% else %}
      {% set selectedVariant = product.defaultVariant %}
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: If you output `url` attribute of lineitem from cart, it links to specific variant, using keyword `variant`.  
  
  ---
  
  