schema.org information on product page - Developer Example

The schema.org website defines a standardized way to include information about your organization, as well as the content of an individual page, in a format that is easy for search engines to consume and process.   It is important to include this information, often called metadata, in all of your pages.  The Storefront system allows you to populate this information quickly and easily.

Each page should contain both an Organization block, as well as an Item block.

 

Header Includes
## uc:item-multimedia-default-used="true"
## uc:site-attribute-string="storefrontSEODescription"
## uc:site-attribute-string="title"
Organization Block
## Organization block for Schema.org
<div itemscope itemtype="https://schema.org/Organization">
  <meta itemprop="name" content= "$site.attr('title')"/>
  <meta itemprop="url" content= "$baseUrl"/>
  #if ($site.attr('storefrontSEODescription') && $site.attr('storefrontSEODescription').length() > 0)
    <meta itemprop="description" content= "${formatHelper.escapeHtml($site.attr('storefrontSEODescription'))}"/>
  #end
</div>
Item Block
## Item block for Schema.org
#if ($item)
<div itemscope itemtype="http://schema.org/Product">
  <meta itemprop="name" content="$formatHelper.escapeHtml($formatHelper.removeHtml(${item.getDescription()}))" />

  #if ($item.getExtendedDescription() && $item.getExtendedDescription().length() > 0)
    <meta itemprop="description" content="${formatHelper.escapeHtml($formatHelper.removeNewLines($formatHelper.removeHtml($item.getExtendedDescription())))}" />
  #end

  #if ($item.getImageURL() && $item.getImageURL().length() > 0)
    <meta itemprop="image" content="$item.getImageURL()" />
  #end

  #if ($item.getBarcode() && $item.getBarcode().length() == 8)
    <meta itemprop="gtin8" content="$item.getBarcode()" />
  #end
  #if ($item.getBarcode() && $item.getBarcode().length() == 13)
    <meta itemprop="gtin13" content="$item.getBarcode()" />
  #end
  #if ($item.getBarcode() && $item.getBarcode().length() == 14)
    <meta itemprop="gtin14" content="$item.getBarcode()" />
  #end

  <meta itemprop="productID" content="${formatHelper.escapeHtml($item.getMerchantItemID())}" />

  <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <meta itemprop="price" content="${formatHelper.formatBigDecimal($item.getCostAsBigDecimal())}" />
    <meta itemprop="priceCurrency" content="${item.getCurrencyCode()}" />

    #if ($item.isPreorder())
      <meta itemprop="availability" content="http://schema.org/PreOrder" />
    #elseif (!$item.isInventoryTracked() || $item.getAvailableQuantity() > 0)
      <meta itemprop="availability" content="http://schema.org/InStock" />
    #else
      <meta itemprop="availability" content="http://schema.org/OutOfStock" />
    #end

    <meta itemprop="itemCondition" content="http://schema.org/NewCondition" />
  </div>
</div>
#end