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.

ImageImageImageImage

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>

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member
Online

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
Newbie

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:

Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'750 FREE OC Extensions on the World's largest 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 954 times


Extensions converted by me | 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 23 guests