trying to implement microdata in PHP Coding Help Posted September 23, 2015 Hello everyone,I am trying to fetch a product price and declare it as an item property for microdata.The following function returns a price and displays it on the page:<?php echo $this->getPriceHtml($_product, true) ?>I don't want to display the price but to insert it in the following code<meta itemprop="price" content=(price) />where (price) is the returned valueI tried this:<?php $_test = $this->getPriceHtml($_product, true) ?> <?php echo $_test ?>the variable $_test displays correctly in my diagnostics.But I cannot get it to work when inserted in the meta call:<meta itemprop="price" content=$_test />Could somebody please show me where I'm going wrong?Thanks
trying to implement microdata
in PHP Coding Help
Posted
Hello everyone,
I am trying to fetch a product price and declare it as an item property for microdata.
The following function returns a price and displays it on the page:
<?php echo $this->getPriceHtml($_product, true) ?>
I don't want to display the price but to insert it in the following code
<meta itemprop="price" content=(price) />
where (price) is the returned value
I tried this:
<?php $_test = $this->getPriceHtml($_product, true) ?>
<?php echo $_test ?>
the variable $_test displays correctly in my diagnostics.
But I cannot get it to work when inserted in the meta call:
<meta itemprop="price" content=$_test />
Could somebody please show me where I'm going wrong?
Thanks