title: Change default variation value for the same product according to the category woocommerce
body: <p>I'm working on a way to display default variations value for the SAME product according to the category he is.
  For example, I sell a card with option blue &amp; red.
  When the user comes by the category ONE, I want the default value is blue.
  If he comes by the category TWO, the value will be red.</p>
  
  <p>I found a hook <code>woocommerce_product_default_attributes</code>, but I don't know how to use it .</p>
  
  <p><strong>Note :</strong> It seems that woocommerce recognize only one category per product even if your product is in two category.</p>
  
  <hr>
  
  <p><strong>Example</strong> <em>(edit)</em>:</p>
  
  <p>I have a product <strong><code>P</code></strong>.<br>
  Product <strong><code>P</code></strong> is in two categories : <code>Cat 1</code> &amp; <code>Cat 2</code>.<br>
  Also, product <strong><code>P</code></strong> has two variables : <strong><code>Blue</code></strong> &amp; <strong><code>Red</code></strong></p>
  
  <p>When the user comes by <strong><code>Cat 1</code></strong>, I want the default value is <strong><code>Blue</code></strong>.
  If he comes by <strong><code>Cat 2</code></strong>, the value will be <strong><code>Red</code></strong>.</p>
  
  <p><strong>The answer code of @LoicTheAztech</strong> <em>(below)</em> works, BUT: </p>
  
  <blockquote>
    <p>When I go to <code>Cat 1</code> or <code>Cat 2</code>, I can see that for Woocommerce, the product is only in <code>Cat 1</code>, even if we can access by both category.</p>
  </blockquote>
  
  <p>So before everything, I need to solve the woocommerce issue.</p>