Skip to content
Browse files

Update schema microdata

* Add priceCurrency

* Change css display:none to meta tags
  • Loading branch information...
1 parent a50acf4 commit 5a890192f9719f085331a10ad0ca6bb062b27164 @haraldpdl committed Aug 4, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 catalog/product_info.php
View
6 catalog/product_info.php
@@ -57,6 +57,8 @@
$products_price .= '<link itemprop="availability" href="http://schema.org/InStock" />';
}
+ $products_price .= '<meta itemprop="priceCurrency" content="' . tep_output_string($currency) . '" />';
+
$products_name = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id']) . '" itemprop="url"><span itemprop="name">' . $product_info['products_name'] . '</span></a>';
if (tep_not_null($product_info['products_model'])) {
@@ -206,7 +208,7 @@
$reviews = tep_db_fetch_array($reviews_query);
if ($reviews['count'] > 0) {
- echo '<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating" style="display: none;"><span itemprop="ratingValue">' . $reviews['avgrating'] . '</span><span itemprop="ratingCount">' . $reviews['count'] . '</span></div>';
+ echo '<span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><meta itemprop="ratingValue" content="' . $reviews['avgrating'] . '" /><meta itemprop="ratingCount" content="' . $reviews['count'] . '" /></span>';
}
?>
@@ -227,7 +229,7 @@
$manufacturer_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$product_info['manufacturers_id'] . "'");
if (tep_db_num_rows($manufacturer_query)) {
$manufacturer = tep_db_fetch_array($manufacturer_query);
- echo '<div itemprop="manufacturer" itemscope itemtype="http://schema.org/Organization" style="display: none;"><span itemprop="name">' . $manufacturer['manufacturers_name'] . '</span></div>';
+ echo '<span itemprop="manufacturer" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="' . tep_output_string($manufacturer['manufacturers_name']) . '" /></span>';
}
}
?>

1 comment on commit 5a89019

@acidvertigo

Nice! For the meta and CSS display none, I'm using these guidelines http://support.google.com/webmasters/bin/answer.py?hl=en&answer=146750

Please sign in to comment.
Something went wrong with that request. Please try again.