title: Shopify: Function to trigger a variant selection change
body: <p>I am trying to add a quantity discount to my shop, but I have some issues. I want to have different variants for a product, and according to the quantity selected, then I add the right variant to the cart. Bascially I manage to do it through the AJAX cart, so the right variant is added to the cart according to the quantity. But now, on the product page, I would like to have the right variant showing with the right price after the quantity has been updated. So after entering the quantity in the quantity box, a function is triggered and updates the selected variant. Something like "onkeyup="myFunction()". Then after reading the quantity box value, choose the right variant and display that variant.</p>
  
  <p>But I cant figure out where the product.selected value is set or how to change it, if it exists as a JSON somewhere, or if this is the right thing to change at all.</p>
  
  <p>I have read that post : <a href="https://stackoverflow.com/questions/19085276/shopify-variants">Shopify Variants</a></p>
  
  <p>It confirms that it is possible but I still can't find how. </p>
  
  <p>Thanks for your help. </p>
  
  <p>Ro</p>