title: displaying a product attribute values as a variable
body: <p>I have a script below where I automatically need to replace two values and I can't get it to work.</p>
  <p>The values can be found as wooCommerce-product-attributes-item__label on the product page.</p>
  <p>For instance, see the below.</p>
  <p>Brand| &quot;Ashley&quot;
  MPN| &quot;234gty&quot;</p>
  <p>I intend to pull the values of each attribute, &quot;Ashley&quot; and &quot;234gty&quot; and use them as variables to fill in the script below.</p>
  <pre><code>   var ccs_cc_args = ccs_cc_args || [];
     
     // Main Product Page
     ccs_cc_args.push(['cpn', '']);
     ccs_cc_args.push(['mf', '&lt;p&gt;&lt;?php echo $brand; ?&gt;&lt;/p&gt;']);
     ccs_cc_args.push(['pn', '&lt;p&gt;&lt;?php echo $mpn; ?&gt;&lt;/p&gt;']);
     ccs_cc_args.push(['upcean', 'UPC_EAN_CODE']);
     ccs_cc_args.push(['ccid', 'CATALOG_CODE']);
     ccs_cc_args.push(['lang', 'LANGUAGE']);
     ccs_cc_args.push(['market', 'MARKET']);
     
     (function () {
        var o = ccs_cc_args; o.push(['_SKey', '3f1b897a']); o.push(['_ZoneId', '6ce9a32538']);
        var sc = document.createElement('script'); sc.type = 'text/javascript'; sc.async = true;
        sc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.cnetcontent.com/jsc/h.js';
        var n = document.getElementsByTagName('script')[0]; n.parentNode.insertBefore(sc, n);
     })();
  </code></pre>
  <p>I've tried adding the following to the footer.php and functions.php and echo to the product page with no luck.</p>
  <p>global $product;</p>
  <p>$mpn = array_shift( wc_get_product_terms( $product-&gt;id, 'pa_mpn', array( 'fields' =&gt; 'names' ) ) );</p>
  <p>$brand = array_shift( wc_get_product_terms( $product-&gt;id, 'pa_brand', array( 'fields' =&gt; 'names' ) ) );</p>