Post by justahippy » Tue Apr 02, 2019 1:13 pm

I know where it goes product.tpl and i know the site to link to schema.org but for the life of me i cant get rid of product errors/warnings related to microdata. I am pretty sure i can make it work with html, but i am a php idiot. Below is my section of code for product microdata, can anyone correct it for me or tell me what i need to do? My error is on offers right now with various other optional warnings for other things they request.
<div itemscope itemtype="http://schema.org/Product">
<meta itemprop="name" content="<?php echo $heading_title; ?>" />
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<?php foreach ($_SESSION as $key => $value){$currency = $value['currency'];}?>
<meta itemprop="priceCurrency" content="<?php echo $currency; ?>">
<meta itemprop="price" content="<?php if (!$special) { echo preg_replace('/[^0-9.]+/','',$price);}else{echo preg_replace('/[^0-9.]+/','',$special);} ?>">
<meta itemprop="availability" content="<?php if ($stock >= 1){echo 'In Stock';}else{echo $stock;} ?>">
<meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/NewCondition" />
</div>
</div>
Thanks for any help!

Newbie

Posts

Joined
Sun Nov 12, 2017 10:16 am

Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by justahippy » Tue Apr 02, 2019 2:00 pm

Error
Either "offers", "review", or "aggregateRating" should be specified

Since we do not offer the option of product reviews, we went with offers in the above code.

Warnings : brand, sku, pricevaliduntil, url and product ID

Newbie

Posts

Joined
Sun Nov 12, 2017 10:16 am

Post by uksitebuilder » Tue Apr 02, 2019 3:28 pm

They're just warning on recommended attributes, not required unless you wish to add them in.

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by khnaz35 » Thu Aug 01, 2019 5:38 pm

justahippy wrote:
Tue Apr 02, 2019 1:13 pm
I know where it goes product.tpl and i know the site to link to schema.org but for the life of me i cant get rid of product errors/warnings related to microdata. I am pretty sure i can make it work with html, but i am a php idiot. Below is my section of code for product microdata, can anyone correct it for me or tell me what i need to do? My error is on offers right now with various other optional warnings for other things they request.
<div itemscope itemtype="http://schema.org/Product">
<meta itemprop="name" content="<?php echo $heading_title; ?>" />
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<?php foreach ($_SESSION as $key => $value){$currency = $value['currency'];}?>
<meta itemprop="priceCurrency" content="<?php echo $currency; ?>">
<meta itemprop="price" content="<?php if (!$special) { echo preg_replace('/[^0-9.]+/','',$price);}else{echo preg_replace('/[^0-9.]+/','',$special);} ?>">
<meta itemprop="availability" content="<?php if ($stock >= 1){echo 'In Stock';}else{echo $stock;} ?>">
<meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/NewCondition" />
</div>
</div>
Thanks for any help!

Does this work for you?
I was searching something over the internet and found this code on https://feedarmy.com/kb/adding-microdat ... -merchant/
hopefully will help you.

Code: Select all

<div itemscope itemtype="http://schema.org/Product">
  <meta itemprop="name" content="<?php echo $heading_title; ?>" />
  <div itemprop="offers" itemscope="" itemtype="http://schema.org/Offer">
    <?php foreach ($_SESSION as $key => $value){$currency = $value['currency'];}?>
    <meta itemprop="priceCurrency" content="<?php echo $currency; ?>">
    <meta itemprop="price" content="<?php if (!$special) { echo preg_replace('/[^0-9.]+/','',$price);}else{echo preg_replace('/[^0-9.]+/','',$special);} ?>">
    <meta itemprop="availability" content="<?php if ($stock >= 1){echo 'In Stock';}else{echo $stock;} ?>">
    <meta itemprop="itemCondition" itemtype="http://schema.org/OfferItemCondition" content="http://schema.org/NewCondition" />
  </div>
</div>

Always help others it's always come back, give and receive :)


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Who is online

Users browsing this forum: No registered users and 55 guests