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.

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>

Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by ahimanshu » Fri Oct 09, 2020 3:45 am

khnaz35 wrote:
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>
Not work for 3x
Warning Invalid enum value in field "availability"
Invalid price format in property "price"

Regards
Himanshu


User avatar
New member

Posts

Joined
Mon Jul 10, 2017 10:55 am
Location - New Delhi

Post by IP_CAM » Fri Oct 09, 2020 9:56 am

Not work for 3x
It does not have to, it's an OC 2 topic here ... :laugh:

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by xxvirusxx » Fri Oct 09, 2020 2:59 pm

ahimanshu wrote:
Fri Oct 09, 2020 3:45 am
Not work for 3x
And is very hard to see the code for 3.x :laugh: :laugh: :laugh: :laugh:
https://feedarmy.com/kb/add-microdata-t ... -shopping/

Attachments

Screenshot_2020-10-09_09-58-08.png

Screenshot_2020-10-09_09-58-08.png (60.92 KiB) Viewed 2746 times


Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România
Who is online

Users browsing this forum: No registered users and 74 guests