Sometimes what a question really needs is a swift kick and "you shouldn't be doing that, or doing it in that way", not enabling a wrong path.
From your PM, I see that you are trying to make some sort of "verified by" badge which is typically done with js. I should really have insisted on your explaining the actual business reason/result you wanted rather than just the detail of what variable you wanted to pick up; then we all would have understood what you were after.
Apparently this badge includes the display of the product name, model, brand, etc., though I don't see how or where from the demo you showed me.
Javascript does not import PHP variables directly. If you want to use the value of a PHP variable in js, you need to echo the variable.
Code:
// * Product Page Fields //
'Brand' : '$manufacturers_name',
'MPN' : '$products_model',
//'RetailerSKU' : '',
'ProductName' : '$products_name',
//'ProductPrice' : 'XXXXX',
//'Condition' : 'XXXXX',
//'StockStatus' : 'XXXXX'
}});
</script>
needs to be like
Code:
// * Product Page Fields //
'Brand' : '<?php echo $manufacturers_name;?>',
'MPN' : '<?php echo $products_model;?>',
//'RetailerSKU' : '',
'ProductName' : '<?php echo $products_name;?>',
//'ProductPrice' : 'XXXXX',
//'Condition' : 'XXXXX',
//'StockStatus' : 'XXXXX'
}});
</script>
Bookmarks