title: woocommerce {{{ data.variation }}} as variable
body: <p><strong>New Question:</strong></p>
  
  <p>Does anyone know how to work with {{{ data.variation }}} in the woocommerce template variation.php?</p>
  
  <p>If I use: {{{ data.variation.variation_id }}} I get an ID printed as 55 (in variables.php, for a selected variation that actually has the ID of 55).</p>
  
  <p>If I use: get_post_meta( '55', '_start_month', true ) I get the variation data that I am looking for.</p>
  
  <p>But (<em>and here is the confusion</em>) if I use </p>
  
  <pre><code>get_post_meta( '{{{ data.variation.variation_id }}}', '_start_month', true )
  </code></pre>
  
  <p>I get null. I can't for the life of me figure out how to use the {{{ data.variation }}} values as numbers.</p>
  
  <p>Argh!!</p>
  
  <p><strong>Previous Question:</strong></p>
  
  <p>I am working in the woocommerce template variation.php.</p>
  
  <p>It has code that includes:</p>
  
  <pre><code>&lt;script type="text/template" id="tmps-variation-template"&gt;
  {{{ data.variation.price_html }}}
  &lt;/script&gt;
  </code></pre>
  
  <p>This renders the price for a product variation. I have modified it to pull another variation like this:</p>
  
  <pre><code>&lt;script type="text/template" id="tmps-variation-template"&gt;
  {{{ data.variation.price_html }}}
  {{{ data.variation.my_number }}}
  &lt;/script&gt;
  </code></pre>
  
  <p>I am then able to pull this into php like this:</p>
  
  <pre><code>$var="{{{ data.variation.my_number }}}";
  echo $var;
  </code></pre>
  
  <p>This shows me the variation value. In this case it is 14.</p>
  
  <p>So, it would seem that I have a value that is accessible to php. But it isn't. I cannot do anything with the value. I can't turn it from a string into an integer or anything like that. For example.</p>
  
  <pre><code>$var=$var * 2;
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>$var= (int) $var;
  $var=$var * 2;
  </code></pre>
  
  <p>Spits out '0';</p>
  
  <p>To investigate, I did a var_dump.</p>
  
  <pre><code>var_dump($var);
  </code></pre>
  
  <p>This shows me that $var is 24 characters long. In other words, I was expecting the value of var_dump($var) to be 2 characters long (the value '14'), but instead var_dump($var) seems to be calculating 'data.variation.my_number' as the value. </p>
  
  <p>So, while it looks like $var=14 it seems to actually be that $var='data.variation.my_number';</p>
  
  <p>I have rewritten this question to try to be more clear. But I think it might still be confusing. The php variable value seems to be the variation name, not the variation value.</p>
  
  <p>Is there any php syntax that I can use to separate one from the other?</p>
  
  <p>Thanks for any insight. I'm hoping this is a quickie for someone who knows of the right method or syntax.</p>